From 1e16c32e5c5fbe1d3bc69ea1fab6be86be429dfc Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 19 Aug 2024 22:59:24 +0200 Subject: [PATCH 1/5] - Using Process-PSModule v3 - Remove nuget from Dependabot settings --- .github/dependabot.yml | 4 ---- .github/workflows/Nightly-Run.yml | 2 +- .github/workflows/Process-PSModule.yml | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b92544a..f57e1e9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,3 @@ updates: directory: / # Location of package manifests schedule: interval: weekly - - package-ecosystem: nuget # See documentation for possible values - directory: / # Location of package manifests - schedule: - interval: weekly diff --git a/.github/workflows/Nightly-Run.yml b/.github/workflows/Nightly-Run.yml index d5b5994..4f56d30 100644 --- a/.github/workflows/Nightly-Run.yml +++ b/.github/workflows/Nightly-Run.yml @@ -10,5 +10,5 @@ permissions: jobs: Process-PSModule: - uses: PSModule/Process-PSModule/.github/workflows/CI.yml@v2 + uses: PSModule/Process-PSModule/.github/workflows/CI.yml@v3 secrets: inherit diff --git a/.github/workflows/Process-PSModule.yml b/.github/workflows/Process-PSModule.yml index 76f9983..da48a8b 100644 --- a/.github/workflows/Process-PSModule.yml +++ b/.github/workflows/Process-PSModule.yml @@ -26,5 +26,5 @@ permissions: jobs: Process-PSModule: - uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v2 + uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v3 secrets: inherit From fe62a86898c5523cf0f47853a91bc215d139154e Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 19 Aug 2024 23:23:15 +0200 Subject: [PATCH 2/5] - Restructure for v3 --- src/classes/{ => private}/Function.ps1 | 0 src/classes/{ => private}/PSModule.ps1 | 0 src/{ => functions}/private/Get-InternalPSModule.ps1 | 0 src/{ => functions}/private/Set-InternalPSModule.ps1 | 0 src/{ => functions}/public/Get-PSModuleTemplate.ps1 | 0 src/{ => functions}/public/New-PSModuleTemplate.ps1 | 0 src/{ => functions}/public/Set-PSModuleTemplate.ps1 | 0 src/{ => functions}/public/Test-PSModuleTemplate.ps1 | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename src/classes/{ => private}/Function.ps1 (100%) rename src/classes/{ => private}/PSModule.ps1 (100%) rename src/{ => functions}/private/Get-InternalPSModule.ps1 (100%) rename src/{ => functions}/private/Set-InternalPSModule.ps1 (100%) rename src/{ => functions}/public/Get-PSModuleTemplate.ps1 (100%) rename src/{ => functions}/public/New-PSModuleTemplate.ps1 (100%) rename src/{ => functions}/public/Set-PSModuleTemplate.ps1 (100%) rename src/{ => functions}/public/Test-PSModuleTemplate.ps1 (100%) diff --git a/src/classes/Function.ps1 b/src/classes/private/Function.ps1 similarity index 100% rename from src/classes/Function.ps1 rename to src/classes/private/Function.ps1 diff --git a/src/classes/PSModule.ps1 b/src/classes/private/PSModule.ps1 similarity index 100% rename from src/classes/PSModule.ps1 rename to src/classes/private/PSModule.ps1 diff --git a/src/private/Get-InternalPSModule.ps1 b/src/functions/private/Get-InternalPSModule.ps1 similarity index 100% rename from src/private/Get-InternalPSModule.ps1 rename to src/functions/private/Get-InternalPSModule.ps1 diff --git a/src/private/Set-InternalPSModule.ps1 b/src/functions/private/Set-InternalPSModule.ps1 similarity index 100% rename from src/private/Set-InternalPSModule.ps1 rename to src/functions/private/Set-InternalPSModule.ps1 diff --git a/src/public/Get-PSModuleTemplate.ps1 b/src/functions/public/Get-PSModuleTemplate.ps1 similarity index 100% rename from src/public/Get-PSModuleTemplate.ps1 rename to src/functions/public/Get-PSModuleTemplate.ps1 diff --git a/src/public/New-PSModuleTemplate.ps1 b/src/functions/public/New-PSModuleTemplate.ps1 similarity index 100% rename from src/public/New-PSModuleTemplate.ps1 rename to src/functions/public/New-PSModuleTemplate.ps1 diff --git a/src/public/Set-PSModuleTemplate.ps1 b/src/functions/public/Set-PSModuleTemplate.ps1 similarity index 100% rename from src/public/Set-PSModuleTemplate.ps1 rename to src/functions/public/Set-PSModuleTemplate.ps1 diff --git a/src/public/Test-PSModuleTemplate.ps1 b/src/functions/public/Test-PSModuleTemplate.ps1 similarity index 100% rename from src/public/Test-PSModuleTemplate.ps1 rename to src/functions/public/Test-PSModuleTemplate.ps1 From 2a0a1ff929440a6b8801131ff555c9aacf1436e5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 20 Aug 2024 23:02:54 +0200 Subject: [PATCH 3/5] Fix permissions on CI --- .github/workflows/Nightly-Run.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Nightly-Run.yml b/.github/workflows/Nightly-Run.yml index 4f56d30..c25d806 100644 --- a/.github/workflows/Nightly-Run.yml +++ b/.github/workflows/Nightly-Run.yml @@ -7,6 +7,8 @@ on: permissions: contents: read + pull-requests: write + statuses: write jobs: Process-PSModule: From c5a027fd4da7bacebde025f8bf2c69e2407899ed Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 20 Aug 2024 23:46:30 +0200 Subject: [PATCH 4/5] disable markdown and yaml prettier linter --- .github/workflows/Linter.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/Linter.yml b/.github/workflows/Linter.yml index 5c9f300..d7650ae 100644 --- a/.github/workflows/Linter.yml +++ b/.github/workflows/Linter.yml @@ -27,3 +27,5 @@ jobs: uses: super-linter/super-linter@latest env: GITHUB_TOKEN: ${{ github.token }} + VALIDATE_MARKDOWN_PRETTIER: false + VALIDATE_YAML_PRETTIER: false From cb7690dc4d6ffd2721190bc9341d5555d4d829d5 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 25 Aug 2024 21:38:44 +0200 Subject: [PATCH 5/5] Fix --- README.md | 2 +- src/classes/private/Function.ps1 | 9 --- src/classes/private/PSModule.ps1 | 11 ---- src/data/Config.psd1 | 3 - src/data/Settings.psd1 | 3 - src/finally.ps1 | 3 - src/formats/CultureInfo.Format.ps1xml | 37 ----------- src/formats/Mygciview.Format.ps1xml | 65 ------------------- .../private/Get-InternalPSModule.ps1 | 18 ----- .../private/Set-InternalPSModule.ps1 | 22 ------- src/functions/public/Get-PSModuleTemplate.ps1 | 18 ----- src/functions/public/New-PSModuleTemplate.ps1 | 22 ------- src/functions/public/Set-PSModuleTemplate.ps1 | 22 ------- src/header.ps1 | 3 - src/init/initializer.ps1 | 3 - src/manifest.psd1 | 5 -- src/modules/OtherPSModule.psm1 | 16 ----- src/scripts/loader.ps1 | 3 - src/types/DirectoryInfo.Types.ps1xml | 21 ------ src/types/FileInfo.Types.ps1xml | 14 ---- 20 files changed, 1 insertion(+), 299 deletions(-) delete mode 100644 src/classes/private/Function.ps1 delete mode 100644 src/classes/private/PSModule.ps1 delete mode 100644 src/data/Config.psd1 delete mode 100644 src/data/Settings.psd1 delete mode 100644 src/finally.ps1 delete mode 100644 src/formats/CultureInfo.Format.ps1xml delete mode 100644 src/formats/Mygciview.Format.ps1xml delete mode 100644 src/functions/private/Get-InternalPSModule.ps1 delete mode 100644 src/functions/private/Set-InternalPSModule.ps1 delete mode 100644 src/functions/public/Get-PSModuleTemplate.ps1 delete mode 100644 src/functions/public/New-PSModuleTemplate.ps1 delete mode 100644 src/functions/public/Set-PSModuleTemplate.ps1 delete mode 100644 src/header.ps1 delete mode 100644 src/init/initializer.ps1 delete mode 100644 src/manifest.psd1 delete mode 100644 src/modules/OtherPSModule.psm1 delete mode 100644 src/scripts/loader.ps1 delete mode 100644 src/types/DirectoryInfo.Types.ps1xml delete mode 100644 src/types/FileInfo.Types.ps1xml diff --git a/README.md b/README.md index c027009..4abb968 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PSModuleTemplate +# OpenAI A PowerShell module template that can be used to create new modules. diff --git a/src/classes/private/Function.ps1 b/src/classes/private/Function.ps1 deleted file mode 100644 index a0421d3..0000000 --- a/src/classes/private/Function.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -class Function { - $Name - $Version - - PSModule ([string] $Name, [string] $Version) { - $this.Name = $Name - $this.Version = $Version - } -} diff --git a/src/classes/private/PSModule.ps1 b/src/classes/private/PSModule.ps1 deleted file mode 100644 index 8746dd2..0000000 --- a/src/classes/private/PSModule.ps1 +++ /dev/null @@ -1,11 +0,0 @@ -class PSModule { - $Name - $Version - $Functions - - PSModule ([string] $Name, [string] $Version, [hashtable] $Functions) { - $this.Name = $Name - $this.Version = $Version - $this.Functions = $Functions - } -} diff --git a/src/data/Config.psd1 b/src/data/Config.psd1 deleted file mode 100644 index fea4466..0000000 --- a/src/data/Config.psd1 +++ /dev/null @@ -1,3 +0,0 @@ -@{ - RandomKey = 'RandomValue' -} diff --git a/src/data/Settings.psd1 b/src/data/Settings.psd1 deleted file mode 100644 index bcfa7b4..0000000 --- a/src/data/Settings.psd1 +++ /dev/null @@ -1,3 +0,0 @@ -@{ - RandomSetting = 'RandomSettingValue' -} diff --git a/src/finally.ps1 b/src/finally.ps1 deleted file mode 100644 index d8fc207..0000000 --- a/src/finally.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Write-Verbose '------------------------------' -Write-Verbose '--- THIS IS A LAST LOADER ---' -Write-Verbose '------------------------------' diff --git a/src/formats/CultureInfo.Format.ps1xml b/src/formats/CultureInfo.Format.ps1xml deleted file mode 100644 index a715e08..0000000 --- a/src/formats/CultureInfo.Format.ps1xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - System.Globalization.CultureInfo - - System.Globalization.CultureInfo - - - - - 16 - - - 16 - - - - - - - - LCID - - - Name - - - DisplayName - - - - - - - - diff --git a/src/formats/Mygciview.Format.ps1xml b/src/formats/Mygciview.Format.ps1xml deleted file mode 100644 index 4c972c2..0000000 --- a/src/formats/Mygciview.Format.ps1xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - mygciview - - System.IO.DirectoryInfo - System.IO.FileInfo - - - PSParentPath - - - - - - 7 - Left - - - - 26 - Right - - - - 26 - Right - - - - 14 - Right - - - - Left - - - - - - - - ModeWithoutHardLink - - - LastWriteTime - - - CreationTime - - - Length - - - Name - - - - - - - - diff --git a/src/functions/private/Get-InternalPSModule.ps1 b/src/functions/private/Get-InternalPSModule.ps1 deleted file mode 100644 index 323f7a6..0000000 --- a/src/functions/private/Get-InternalPSModule.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -function Get-InternalPSModule { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Get-InternalPSModule -Name 'World' - - "Hello, World!" - #> - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/functions/private/Set-InternalPSModule.ps1 b/src/functions/private/Set-InternalPSModule.ps1 deleted file mode 100644 index 4b46032..0000000 --- a/src/functions/private/Set-InternalPSModule.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -function Set-InternalPSModule { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Set-InternalPSModule -Name 'World' - - "Hello, World!" - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', - Justification = 'Reason for suppressing' - )] - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/functions/public/Get-PSModuleTemplate.ps1 b/src/functions/public/Get-PSModuleTemplate.ps1 deleted file mode 100644 index 014b47c..0000000 --- a/src/functions/public/Get-PSModuleTemplate.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -function Get-PSModuleTemplate { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Get-PSModuleTemplate -Name 'World' - - "Hello, World!" - #> - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/functions/public/New-PSModuleTemplate.ps1 b/src/functions/public/New-PSModuleTemplate.ps1 deleted file mode 100644 index 8d5f1fd..0000000 --- a/src/functions/public/New-PSModuleTemplate.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -function New-PSModuleTemplate { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - New-PSModuleTemplate -Name 'World' - - "Hello, World!" - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', - Justification = 'Reason for suppressing' - )] - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/functions/public/Set-PSModuleTemplate.ps1 b/src/functions/public/Set-PSModuleTemplate.ps1 deleted file mode 100644 index 51f099c..0000000 --- a/src/functions/public/Set-PSModuleTemplate.ps1 +++ /dev/null @@ -1,22 +0,0 @@ -function Set-PSModuleTemplate { - <# - .SYNOPSIS - Performs tests on a module. - - .EXAMPLE - Set-PSModuleTemplate -Name 'World' - - "Hello, World!" - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute( - 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', - Justification = 'Reason for suppressing' - )] - [CmdletBinding()] - param ( - # Name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/header.ps1 b/src/header.ps1 deleted file mode 100644 index cc1fde9..0000000 --- a/src/header.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidLongLines', '', Justification = 'Contains long links.')] -[CmdletBinding()] -param() diff --git a/src/init/initializer.ps1 b/src/init/initializer.ps1 deleted file mode 100644 index 28396fb..0000000 --- a/src/init/initializer.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Write-Verbose '-------------------------------' -Write-Verbose '--- THIS IS AN INITIALIZER ---' -Write-Verbose '-------------------------------' diff --git a/src/manifest.psd1 b/src/manifest.psd1 deleted file mode 100644 index ff720bd..0000000 --- a/src/manifest.psd1 +++ /dev/null @@ -1,5 +0,0 @@ -# This file always wins! -# Use this file to override any of the framework defaults and generated values. -@{ - ModuleVersion = '0.0.0' -} diff --git a/src/modules/OtherPSModule.psm1 b/src/modules/OtherPSModule.psm1 deleted file mode 100644 index a9177f7..0000000 --- a/src/modules/OtherPSModule.psm1 +++ /dev/null @@ -1,16 +0,0 @@ -function Get-OtherPSModule { - <# - .SYNOPSIS - A brief description of the function - - .EXAMPLE - Get-OtherPSModule -Name "World" - #> - [CmdletBinding()] - param( - # The name of the person to greet. - [Parameter(Mandatory)] - [string] $Name - ) - Write-Output "Hello, $Name!" -} diff --git a/src/scripts/loader.ps1 b/src/scripts/loader.ps1 deleted file mode 100644 index 973735a..0000000 --- a/src/scripts/loader.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -Write-Verbose '-------------------------' -Write-Verbose '--- THIS IS A LOADER ---' -Write-Verbose '-------------------------' diff --git a/src/types/DirectoryInfo.Types.ps1xml b/src/types/DirectoryInfo.Types.ps1xml deleted file mode 100644 index aef538b..0000000 --- a/src/types/DirectoryInfo.Types.ps1xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - System.IO.FileInfo - - - Status - Success - - - - - System.IO.DirectoryInfo - - - Status - Success - - - - diff --git a/src/types/FileInfo.Types.ps1xml b/src/types/FileInfo.Types.ps1xml deleted file mode 100644 index 4cfaf6b..0000000 --- a/src/types/FileInfo.Types.ps1xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - System.IO.FileInfo - - - Age - - ((Get-Date) - ($this.CreationTime)).Days - - - - -