Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/linters/.jscpd.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"ignore": [
"**/tests/**",
"**/.github/workflows/Action-Test.yml",
"**/scripts/helpers/Build/Build-PSModuleManifest.ps1",
"**/scripts/helpers/Build/Build-PSModuleRootModule.ps1",
"**/scripts/helpers/Build/PSScriptAnalyzer.Tests.psd1"
"**/scripts/helpers/**"
],
"absolute": true
}
9 changes: 0 additions & 9 deletions .github/workflows/Action-Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Initialize environment
uses: PSModule/Initialize-PSModule@v1

- name: Action-Test
uses: ./
with:
Expand All @@ -42,9 +39,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Initialize environment
uses: PSModule/Initialize-PSModule@v1

- name: Action-Test
uses: ./
with:
Expand All @@ -59,9 +53,6 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4

- name: Initialize environment
uses: PSModule/Initialize-PSModule@v1

- name: Action-Test
uses: ./
with:
Expand Down
2 changes: 0 additions & 2 deletions scripts/helpers/Build-PSModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#>
[OutputType([void])]
[CmdletBinding()]
#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' }
#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' }
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSReviewUnusedParameter', '', Scope = 'Function',
Justification = 'LogGroup - Scoping affects the variables line of sight.'
Expand Down
1 change: 0 additions & 1 deletion scripts/helpers/Build/Build-PSModuleBase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
Build-PSModuleBase -SourceFolderPath 'C:\MyModule\src\MyModule' -OutputFolderPath 'C:\MyModule\build\MyModule'
#>
[CmdletBinding()]
#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' }
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSReviewUnusedParameter', '', Scope = 'Function',
Justification = 'LogGroup - Scoping affects the variables line of sight.'
Expand Down
8 changes: 3 additions & 5 deletions scripts/helpers/Build/Build-PSModuleManifest.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
Build-PSModuleManifest -SourceFolderPath 'C:\MyModule\src\MyModule' -OutputFolderPath 'C:\MyModule\build\MyModule'
#>
[CmdletBinding()]
#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' }
#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' }
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidLongLines', '', Scope = 'Function',
Justification = 'Easier to read the multi ternery operators in a single line.'
Expand Down Expand Up @@ -60,10 +58,10 @@
$manifest.ModuleVersion = '999.0.0'
Write-Host "[ModuleVersion] - [$($manifest.ModuleVersion)]"

$manifest.Author = $manifest.Keys -contains 'Author' ? ($manifest.Author | IsNotNullOrEmpty) ? $manifest.Author : $env:GITHUB_REPOSITORY_OWNER : $env:GITHUB_REPOSITORY_OWNER
$manifest.Author = $manifest.Keys -contains 'Author' ? (-not [string]::IsNullOrEmpty($manifest.Author)) ? $manifest.Author : $env:GITHUB_REPOSITORY_OWNER : $env:GITHUB_REPOSITORY_OWNER
Write-Host "[Author] - [$($manifest.Author)]"

$manifest.CompanyName = $manifest.Keys -contains 'CompanyName' ? ($manifest.CompanyName | IsNotNullOrEmpty) ? $manifest.CompanyName : $env:GITHUB_REPOSITORY_OWNER : $env:GITHUB_REPOSITORY_OWNER
$manifest.CompanyName = $manifest.Keys -contains 'CompanyName' ? (-not [string]::IsNullOrEmpty($manifest.CompanyName)) ? $manifest.CompanyName : $env:GITHUB_REPOSITORY_OWNER : $env:GITHUB_REPOSITORY_OWNER
Write-Host "[CompanyName] - [$($manifest.CompanyName)]"

$year = Get-Date -Format 'yyyy'
Expand All @@ -73,7 +71,7 @@
Write-Host "[Copyright] - [$($manifest.Copyright)]"

$repoDescription = gh repo view --json description | ConvertFrom-Json | Select-Object -ExpandProperty description
$manifest.Description = $manifest.Keys -contains 'Description' ? ($manifest.Description | IsNotNullOrEmpty) ? $manifest.Description : $repoDescription : $repoDescription
$manifest.Description = $manifest.Keys -contains 'Description' ? (-not [string]::IsNullOrEmpty($manifest.Description)) ? $manifest.Description : $repoDescription : $repoDescription
Write-Host "[Description] - [$($manifest.Description)]"

$manifest.PowerShellHostName = $manifest.Keys -contains 'PowerShellHostName' ? -not [string]::IsNullOrEmpty($manifest.PowerShellHostName) ? $manifest.PowerShellHostName : $null : $null
Expand Down
5 changes: 1 addition & 4 deletions scripts/helpers/Build/Build-PSModuleRootModule.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' }
#Requires -Modules @{ ModuleName = 'Hashtable'; ModuleVersion = '1.1.1' }

function Build-PSModuleRootModule {
function Build-PSModuleRootModule {
<#
.SYNOPSIS
Compiles the module root module files.
Expand Down
9 changes: 3 additions & 6 deletions scripts/helpers/Build/Get-PSModuleAliasesToExport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
Get-PSModuleAliasesToExport -SourceFolderPath 'C:\MyModule\src\MyModule'
#>
[CmdletBinding()]
#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' }
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', '', Scope = 'Function',
Justification = 'Want to just write to the console, not the pipeline.'
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Scope = 'Function', Justification = 'Want to just write to the console, not the pipeline.')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Scope = 'Function', Justification = 'Contains long links.')]
param(
# Path to the folder where the module source code is located.
[Parameter(Mandatory)]
Expand All @@ -30,7 +27,7 @@
$manifest = Get-ModuleManifest -Path $manifestFilePath -Verbose:$false

Write-Host "[$manifestPropertyName]"
$aliasesToExport = (($manifest.AliasesToExport).count -eq 0) -or ($manifest.AliasesToExport | IsNullOrEmpty) ? '*' : $manifest.AliasesToExport
$aliasesToExport = (($manifest.AliasesToExport).count -eq 0) -or [string]::IsNullOrEmpty($manifest.AliasesToExport) ? '*' : $manifest.AliasesToExport
$aliasesToExport | ForEach-Object {
Write-Host "[$manifestPropertyName] - [$_]"
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/helpers/Build/Get-PSModuleClassesToExport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
.NOTES
Inspired by [about_Classes | Exporting classes with type accelerators](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_classes?view=powershell-7.4#exporting-classes-with-type-accelerators)
#>
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Justification = 'Contains long links.')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Scope = 'Function', Justification = 'Contains long links.')]
[CmdletBinding()]
param (
# The path to the module root folder.
Expand Down
9 changes: 3 additions & 6 deletions scripts/helpers/Build/Get-PSModuleCmdletsToExport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
Get-PSModuleCmdletsToExport -SourceFolderPath 'C:\MyModule\src\MyModule'
#>
[CmdletBinding()]
#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' }
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', '', Scope = 'Function',
Justification = 'Want to just write to the console, not the pipeline.'
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Scope = 'Function', Justification = 'Want to just write to the console, not the pipeline.')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Scope = 'Function', Justification = 'Contains long links.')]
param(
# Path to the folder where the module source code is located.
[Parameter(Mandatory)]
Expand All @@ -30,7 +27,7 @@
$manifest = Get-ModuleManifest -Path $manifestFilePath -Verbose:$false

Write-Host "[$manifestPropertyName]"
$cmdletsToExport = (($manifest.CmdletsToExport).count -eq 0) -or ($manifest.CmdletsToExport | IsNullOrEmpty) ? '' : $manifest.CmdletsToExport
$cmdletsToExport = (($manifest.CmdletsToExport).count -eq 0) -or [string]::IsNullOrEmpty($manifest.CmdletsToExport) ? '' : $manifest.CmdletsToExport
$cmdletsToExport | ForEach-Object {
Write-Host "[$manifestPropertyName] - [$_]"
}
Expand Down
6 changes: 2 additions & 4 deletions scripts/helpers/Build/Get-PSModuleFunctionsToExport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
Get-PSModuleFunctionsToExport -SourceFolderPath 'C:\MyModule\src\MyModule'
#>
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', '', Scope = 'Function',
Justification = 'Want to just write to the console, not the pipeline.'
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingWriteHost', '', Scope = 'Function', Justification = 'Want to just write to the console, not the pipeline.')]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Scope = 'Function', Justification = 'Contains long links.')]
[OutputType([array])]
param(
# Path to the folder where the module source code is located.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
'PSAvoidUsingWriteHost', '', Scope = 'Function',
Justification = 'Want to just write to the console, not the pipeline.'
)]
#Requires -Modules @{ ModuleName = 'GitHub'; ModuleVersion = '0.13.2' }
#Requires -Modules @{ ModuleName = 'Utilities'; ModuleVersion = '0.3.0' }
[CmdletBinding()]
param(
# Name of the module.
Expand Down
2 changes: 0 additions & 2 deletions scripts/main.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
[CmdletBinding()]
param()

#Requires -Modules Utilities

$path = (Join-Path -Path $PSScriptRoot -ChildPath 'helpers') | Get-Item | Resolve-Path -Relative
LogGroup "Loading helper scripts from [$path]" {
Get-ChildItem -Path $path -Filter '*.ps1' -Recurse | Resolve-Path -Relative | ForEach-Object {
Expand Down
Loading