From ab5cfd908d52b8c8681a4481d034dc3c7400eaae Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Thu, 3 Mar 2022 16:32:49 -0500 Subject: [PATCH 1/5] update releaseBuild.yml --- .ci/releaseBuild.yml | 202 ++++++++++++++++++++++++++++--------------- 1 file changed, 130 insertions(+), 72 deletions(-) diff --git a/.ci/releaseBuild.yml b/.ci/releaseBuild.yml index b4fafe68..ed9a4979 100644 --- a/.ci/releaseBuild.yml +++ b/.ci/releaseBuild.yml @@ -1,138 +1,190 @@ -# The name of the build that will be seen in mscodehub -name: PowerShellGetv2-Release-$(Build.BuildId) -# how is the build triggered -# since this is a release build, no trigger as it's a manual release +name: $(BuildDefinitionName)-$(date:yyMM).$(date:dd)$(rev:rrr) trigger: none +pr: none -pr: - branches: - include: - - master - -# variables to set in the build environment variables: - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - POWERSHELL_TELEMETRY_OPTOUT: 1 + - group: ESRP + - name: ModuleName + value: 'PowerShellGet' + - name: BuildOutputPath + value: '$(Build.SourcesDirectory)\dist\PowerShellGet' + - name: SignedOutputPath + value: '$(Build.SourcesDirectory)/signed' -# since this build relies on templates, we need access to those -# This needs a service connection in the build to work -# the *name* of the service connection must be the same as the endpoint resources: repositories: - repository: ComplianceRepo type: github endpoint: ComplianceGHRepo name: PowerShell/compliance - # this can be any branch of your choosing - ref: master -# the stages in this build. There are 2 -# the assumption for PowerShellGetv2 is that test is done as part of -# CI so we needn't do it here stages: - stage: Build - displayName: Build - pool: - name: Package ES CodeHub Lab E + displayName: Build PowerShellGetV2 Module Package jobs: - - job: Build_Job - displayName: Build Microsoft.PowerShell.PowerShellGetv2 - # note the variable reference to ESRP. - # this must be created in Project -> Pipelines -> Library -> VariableGroups - # where it describes the link to the SigningServer - variables: - - group: ESRP + - job: BuildPkg + displayName: Build Package + pool: + name: 1ES + demands: + - ImageOverride -equals PSMMS2019-Secure + + steps: - - checkout: self - # the steps for building the module go here - pwsh: | - Set-Location "$(Build.SourcesDirectory)/PowerShellGetv2" + Get-ChildItem -Path env: + Get-ChildItem -Path env: + displayName: Capture environment for build + condition: succeededOrFailed() + + - pwsh: | + Set-Location "$(Build.SourcesDirectory)" Import-Module ./tools/build.psm1 -Force Install-Dependencies Update-ModuleManifestFunctions Publish-ModuleArtifacts - displayName: Execute build + displayName: Build and publish artifact - # these are setting vso variables which will be persisted between stages - pwsh: | - $signSrcPath = "$(Build.SourcesDirectory)/PowerShellGetv2/dist/PowerShellGet" - dir - # Set signing src path variable + $signSrcPath = "$(BuildOutputPath)" $vstsCommandString = "vso[task.setvariable variable=signSrcPath]${signSrcPath}" Write-Host "sending " + $vstsCommandString Write-Host "##$vstsCommandString" - $signOutPath = "$(Build.SourcesDirectory)/OSS_Microsoft_PowerShellGetv2/signed/PowerShellGet" - $null = New-Item -ItemType Directory -Path $signOutPath -force - # Set signing out path variable - $vstsCommandString = "vso[task.setvariable variable=signOutPath]${signOutPath}" + $outSignPath = "$(BuildOutputPath)" + $vstsCommandString = "vso[task.setvariable variable=signOutPath]${outSignPath}" Write-Host "sending " + $vstsCommandString Write-Host "##$vstsCommandString" + displayName: Create fake source and output variables for signing template and no signing + condition: and(succeeded(), eq(variables['SkipSigning'], 'True')) + + - pwsh: | + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + + # Created files signing directory + $srcPath = "$(BuildOutputPath)" + $createdSignSrcPath = "$(SignedOutputPath)\CreatedFiles" + if (! (Test-Path -Path $createdSignSrcPath)) { + $null = New-Item -Path $createdSignSrcPath -ItemType Directory -Verbose + } + Copy-Item -Path $srcPath -Dest $createdSignSrcPath -Recurse -Force -Verbose - # Set path variable for guardian codesign validation - $vstsCommandString = "vso[task.setvariable variable=GDN_CODESIGN_TARGETDIRECTORY]${signOutPath}" + $signOutPath = "$(SignedOutputPath)\$(ModuleName)" + if (! (Test-Path -Path $signOutPath)) { + $null = New-Item -Path $signOutPath -ItemType Directory + } + + # Set signing src path variable + $vstsCommandString = "vso[task.setvariable variable=signSrcPath]${createdSignSrcPath}" Write-Host "sending " + $vstsCommandString Write-Host "##$vstsCommandString" - # Get version and create a variable - $moduleData = Import-PowerShellDataFile "$(Build.SourcesDirectory)/PowerShellGetv2/dist/PowerShellGet/PowerShellGet.psd1" - $moduleVersion = $moduleData.ModuleVersion - $vstsCommandString = "vso[task.setvariable variable=moduleVersion]${moduleVersion}" + $outSignPath = "$(SignedOutputPath)\$(ModuleName)" + if (! (Test-Path -Path $outSignPath)) { + $null = New-Item -Path $outSignPath -ItemType Directory -Verbose + } + + # Set signing out path variable + $vstsCommandString = "vso[task.setvariable variable=signOutPath]${outSignPath}" Write-Host "sending " + $vstsCommandString Write-Host "##$vstsCommandString" - displayName: Setup variables for signing + displayName: Set up for module created files code signing + condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), ne(variables['SkipSigning'], 'True')) - # checkout the Compliance repository so it can be used to do the actual signing - - checkout: ComplianceRepo + - pwsh: | + Get-ChildItem -Path env: + Get-ChildItem -Path . -Recurse -Directory + displayName: Capture environment for code signing + condition: succeededOrFailed() - # this the MS authored step This cert covers MS autored items - # note that the buildOutputPath (where we get the files to sign) - # is the same as the signOutputPath in the previous step - # at the end of this step we will have all the files signed that should be - # signOutPath is the location which contains the files we will use to make the module - template: EsrpSign.yml@ComplianceRepo parameters: - # the folder which contains the binaries to sign buildOutputPath: $(signSrcPath) - # the location to put the signed output signOutputPath: $(signOutPath) - # the certificate ID to use (Authenticode) certificateId: "CP-230012" pattern: | **\*.psd1 **\*.psm1 **\*.ps1xml **\*.mof + useMinimatch: true + + - pwsh: | + $srcPath = "$(BuildOutputPath)" + $signOutPath = "$(SignedOutputPath)\$(ModuleName)" + if (! (Test-Path -Path $signOutPath)) { + $null = New-Item -Path $signOutPath -ItemType Directory + } + + Get-ChildItem -Path $srcPath | Foreach-Object { + if ($_.Attributes -ne "Directory") + { + $sig = Get-AuthenticodeSignature -FilePath $_.FullName + if ($sig.Status -eq 'Valid' -and ($sig.SignerCertificate.Subject -like '*Microsoft*' -and $sig.SignerCertificate.Issuer -like '*Microsoft Code Signing PCA*')) { + # Copy already signed files directly to output + Copy-Item -Path $_.FullName -Dest $signOutPath -Force -Verbose + } + } + } + displayName: Copy already properly signed files (.psd1, .psm1, .ps1xml, .mof) + condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), ne(variables['SkipSigning'], 'True')) + + - ${{ if ne(variables.SkipSigning, 'True') }}: + - template: Sbom.yml@ComplianceRepo + parameters: + BuildDropPath: $(signOutPath) + Build_Repository_Uri: 'https://github.com/powershell/powershellgetv2' + PackageName: 'PowerShellGet' + PackageVersion: '2.2.5.1' + + - pwsh: | + $srcModulePath = Resolve-Path -Path "$(signOutPath)" # build drop path -- '$(Build.SourcesDirectory)/signed/PowerShellGet' + $nupkgPath = "$(SignedOutputPath)/nupkg" # '$(Build.SourcesDirectory)/signed/nupkg' + $tmpPkgMgmtDir = "$(SignedOutputPath)/tmpDir" # '$(Build.SourcesDirectory)/signed/tmpDir' + mkdir $nupkgPath + mkdir $tmpPkgMgmtDir - # finally publish the parts of the build which will be used in the next stages - # if it's not published, the subsequent stages will not be able to access it. - # This is the build directory (it contains all of the dll/pdb files) - - publish: "$(Build.SourcesDirectory)/OSS_Microsoft_PowerShellGetv2" - artifact: build - displayName: publish build directory + $srcLocation = [System.Uri] $nupkgPath.ToString() + Register-PSRepository -Name "LocalNupkgRepo" -SourceLocation $srcLocation # '$(Build.SourcesDirectory)/signed/nupkg' + $moduleToPublish = Join-Path -Path $srcModulePath -ChildPath "PowerShellGet" # '$(Build.SourcesDirectory)/signed/PowerShellGet/PowerShellGet' + + Save-Module -Name PackageManagement -Repository PSGallery -Path $tmpPkgMgmtDir ## '$(Build.SourcesDirectory)/signed/tmpDir' + Publish-Module -Path (Join-Path -Path $tmpPkgMgmtDir -ChildPath "PackageManagement") -Repository "LocalNupkgRepo" # '$(Build.SourcesDirectory)/signed/nupkg' + + Publish-Module -Path $moduleToPublish -Repository "LocalNupkgRepo" # '$(Build.SourcesDirectory)/signed/nupkg' + + Remove-Item $nupkgPath/PackageManagement*.nupkg + $artifactName = "$(ModuleName)" + $nupkgName = "nupkg" + Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$nupkgName;]$nupkgPath" + Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$srcModulePath" + displayName: Create module artifacts (including .nupkg) # Now on to the compliance stage - stage: compliance displayName: Compliance dependsOn: Build jobs: - - job: Compliance_Job + - job: ComplianceJob pool: - name: Package ES CodeHub Lab E + name: 1ES + demands: + - ImageOverride -equals PSMMS2019-Secure + steps: - checkout: self + clean: true - checkout: ComplianceRepo + clean: true - download: current - artifact: build - - # use the templates in the compliance repo - # since script analyzer has modules, we're using the assembly-module-compliance template - # if you don't have assemblies, you should use script-module-compliance template + artifact: 'PowerShellGet' - template: script-module-compliance.yml@ComplianceRepo parameters: # component-governance - the path to sources sourceScanPath: '$(Build.SourcesDirectory)' + # credscan + suppressionsFile: '' # TermCheck optionsRulesDBPath: '' optionsFTPath: '' @@ -141,3 +193,9 @@ stages: codeBaseName: 'PowerShellGetv2_20200129' # selections APIScan: false # set to false when not using Windows APIs. + +- stage: Release + displayName: Publish Package to PSGallery + condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), eq(variables['Publish'], 'True')) + jobs: + - template: release.yml From 002df68ec185c2b02a0ca22454badeebaf7774d5 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Thu, 3 Mar 2022 16:33:50 -0500 Subject: [PATCH 2/5] add release.yml which contains steps to push and release to psgallery --- .ci/release.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .ci/release.yml diff --git a/.ci/release.yml b/.ci/release.yml new file mode 100644 index 00000000..d1e693f1 --- /dev/null +++ b/.ci/release.yml @@ -0,0 +1,35 @@ +parameters: + jobName: release + displayName: 'Release PowerShellGet to PSGallery' + +jobs: +- job: ${{ parameters.jobName }} + pool: + name: 1ES + demands: + - ImageOverride -equals PSMMS2019-Secure + displayName: ${{ parameters.displayName }} + + steps: + - task: DownloadPipelineArtifact@2 + displayName: 'Download PowerShellGet module artifacts' + inputs: + artifact: nupkg + patterns: '**/PowerShellGet*.nupkg' + downloadPath: '$(Pipeline.Workspace)/nuget' + + - powershell: | + $package = (Get-ChildItem '$(Pipeline.Workspace)/nuget/PowerShellGet.*.nupkg').FullName + $package + $vstsCommandString = "vso[task.setvariable variable=NugetPkgPath]${package}" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + displayName: 'Capture PowerShellGet module NuGet package path and set environment variable' + + - task: NuGetCommand@2 + displayName: 'Push PowerShellGet module artifacts to PSGallery feed' + inputs: + command: push + packagesToPush: '$(NugetPkgPath)' + nuGetFeedType: external + publishFeedCredentials: PSGalleryPush From 804fb07759bbeb0513167f941501c78459f840a3 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Thu, 3 Mar 2022 16:34:58 -0500 Subject: [PATCH 3/5] update package version in PowerShellGet.psd1 file --- src/PowerShellGet/PowerShellGet.psd1 | 160 +++++++++++++-------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/src/PowerShellGet/PowerShellGet.psd1 b/src/PowerShellGet/PowerShellGet.psd1 index 43a834df..072b5511 100644 --- a/src/PowerShellGet/PowerShellGet.psd1 +++ b/src/PowerShellGet/PowerShellGet.psd1 @@ -1,60 +1,60 @@ @{ - RootModule = 'PSModule.psm1' - ModuleVersion = '2.2.5' - GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404' - Author = 'Microsoft Corporation' - CompanyName = 'Microsoft Corporation' - Copyright = '(c) Microsoft Corporation. All rights reserved.' - Description = 'PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts.' - PowerShellVersion = '3.0' - FormatsToProcess = 'PSGet.Format.ps1xml' - FunctionsToExport = @( - 'Find-Command', - 'Find-DSCResource', - 'Find-Module', - 'Find-RoleCapability', - 'Find-Script', - 'Get-CredsFromCredentialProvider', - 'Get-InstalledModule', - 'Get-InstalledScript', - 'Get-PSRepository', - 'Install-Module', - 'Install-Script', - 'New-ScriptFileInfo', - 'Publish-Module', - 'Publish-Script', - 'Register-PSRepository', - 'Save-Module', - 'Save-Script', - 'Set-PSRepository', - 'Test-ScriptFileInfo', - 'Uninstall-Module', - 'Uninstall-Script', - 'Unregister-PSRepository', - 'Update-Module', - 'Update-ModuleManifest', - 'Update-Script', - 'Update-ScriptFileInfo') - - VariablesToExport = 'PSGetPath' - AliasesToExport = @('inmo', 'fimo', 'upmo', 'pumo') - FileList = @('PSModule.psm1', - 'PSGet.Format.ps1xml', - 'PSGet.Resource.psd1') - RequiredModules = @(@{ModuleName = 'PackageManagement'; ModuleVersion = '1.4.4' }) - PrivateData = @{ - "PackageManagementProviders" = 'PSModule.psm1' - "SupportedPowerShellGetFormatVersions" = @('1.x', '2.x') - PSData = @{ - Tags = @('Packagemanagement', - 'Provider', - 'PSEdition_Desktop', - 'PSEdition_Core', - 'Linux', - 'Mac') - ProjectUri = 'https://go.microsoft.com/fwlink/?LinkId=828955' - LicenseUri = 'https://go.microsoft.com/fwlink/?LinkId=829061' - ReleaseNotes = @' + RootModule = 'PSModule.psm1' + ModuleVersion = '2.2.5.1' + GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = '(c) Microsoft Corporation. All rights reserved.' + Description = 'PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts.' + PowerShellVersion = '3.0' + FormatsToProcess = 'PSGet.Format.ps1xml' + FunctionsToExport = @( + 'Find-Command', + 'Find-DSCResource', + 'Find-Module', + 'Find-RoleCapability', + 'Find-Script', + 'Get-CredsFromCredentialProvider', + 'Get-InstalledModule', + 'Get-InstalledScript', + 'Get-PSRepository', + 'Install-Module', + 'Install-Script', + 'New-ScriptFileInfo', + 'Publish-Module', + 'Publish-Script', + 'Register-PSRepository', + 'Save-Module', + 'Save-Script', + 'Set-PSRepository', + 'Test-ScriptFileInfo', + 'Uninstall-Module', + 'Uninstall-Script', + 'Unregister-PSRepository', + 'Update-Module', + 'Update-ModuleManifest', + 'Update-Script', + 'Update-ScriptFileInfo') + + VariablesToExport = 'PSGetPath' + AliasesToExport = @('inmo', 'fimo', 'upmo', 'pumo') + FileList = @('PSModule.psm1', + 'PSGet.Format.ps1xml', + 'PSGet.Resource.psd1') + RequiredModules = @(@{ModuleName = 'PackageManagement'; ModuleVersion = '1.4.4' }) + PrivateData = @{ + "PackageManagementProviders" = 'PSModule.psm1' + "SupportedPowerShellGetFormatVersions" = @('1.x', '2.x') + PSData = @{ + Tags = @('Packagemanagement', + 'Provider', + 'PSEdition_Desktop', + 'PSEdition_Core', + 'Linux', + 'Mac') + ProjectUri = 'https://go.microsoft.com/fwlink/?LinkId=828955' + LicenseUri = 'https://go.microsoft.com/fwlink/?LinkId=829061' + ReleaseNotes = @' ### 2.2.5 - Security patch for code injection bug @@ -119,7 +119,7 @@ New Feature Breaking Change - Default installation scope for Update-Module and Update-Script has changed to match Install-Module and Install-Script. For Windows PowerShell (version 5.1 or below), the default scope is AllUsers when running in an elevated session, and CurrentUser at all other times. - For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. (#421) +For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. (#421) Bug Fixes @@ -163,7 +163,7 @@ Bug fixes Breaking Change - Default installation scope for Install-Module, Install-Script, and Install-Package has changed. For Windows PowerShell (version 5.1 or below), the default scope is AllUsers when running in an elevated session, and CurrentUser at all other times. - For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. +For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. ## 1.6.7 @@ -190,18 +190,18 @@ Bug fixes New features * Allow Pester/PSReadline installation when signed by non-Microsoft certificate (#258) - - Whitelist installation of non-Microsoft signed Pester and PSReadline over Microsoft signed Pester and PSReadline. +- Whitelist installation of non-Microsoft signed Pester and PSReadline over Microsoft signed Pester and PSReadline. Build and Code Cleanup Improvements * Splitting of functions (#229) (Thanks @Benny1007) - - Moves private functions into respective private folder. - - Moves public functions as defined in PSModule.psd1 into respective public folder. - - Removes all functions from PSModule.psm1 file. - - Dot sources the functions from PSModule.psm1 file. - - Uses Export-ModuleMember to export the public functions from PSModule.psm1 file. +- Moves private functions into respective private folder. +- Moves public functions as defined in PSModule.psd1 into respective public folder. +- Removes all functions from PSModule.psm1 file. +- Dot sources the functions from PSModule.psm1 file. +- Uses Export-ModuleMember to export the public functions from PSModule.psm1 file. * Add build step to construct a single .psm1 file (#242) (Thanks @Benny1007) - - Merged public and private functions into one .psm1 file to increase load time performance. +- Merged public and private functions into one .psm1 file to increase load time performance. Bug fixes - Fix null parameter error caused by MinimumVersion in Publish-PackageUtility (#201) @@ -217,15 +217,15 @@ Bug fixes New features * Prerelease Version Support (#185) - - Implemented prerelease versions functionality in PowerShellGet cmdlets. - - Enables publishing, discovering, and installing the prerelease versions of modules and scripts from the PowerShell Gallery. - - [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/PrereleaseModule) +- Implemented prerelease versions functionality in PowerShellGet cmdlets. +- Enables publishing, discovering, and installing the prerelease versions of modules and scripts from the PowerShell Gallery. +- [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/PrereleaseModule) * Enabled publish cmdlets on PWSH and Nano Server (#196) - - Dotnet command version 2.0.0 or newer should be installed by the user prior to using the publish cmdlets on PWSH and Windows Nano Server. - - Users can install the dotnet command by following the instructions specified at https://aka.ms/dotnet-install-script. - - On Windows, users can install the dotnet command by running *Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile '.\dotnet-install.ps1'; & '.\dotnet-install.ps1' -Channel Current -Version '2.0.0'* - - Publish cmdlets on Windows PowerShell supports using the dotnet command for publishing operations. +- Dotnet command version 2.0.0 or newer should be installed by the user prior to using the publish cmdlets on PWSH and Windows Nano Server. +- Users can install the dotnet command by following the instructions specified at https://aka.ms/dotnet-install-script. +- On Windows, users can install the dotnet command by running *Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile '.\dotnet-install.ps1'; & '.\dotnet-install.ps1' -Channel Current -Version '2.0.0'* +- Publish cmdlets on Windows PowerShell supports using the dotnet command for publishing operations. Breaking Change - PWSH: Changed the installation location of AllUsers scope to the parent of $PSHOME instead of $PSHOME. It is the SHARED_MODULES folder on PWSH. @@ -239,14 +239,14 @@ Bug fixes New features * Added support for modules requiring license acceptance (#150) - - [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/RequireLicenseAcceptance) +- [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/RequireLicenseAcceptance) * Added version for REQUIREDSCRIPTS (#162) - - Enabled following scenarios for REQUIREDSCRIPTS - - [1.0] - RequiredVersion - - [1.0,2.0] - Min and Max Version - - (,1.0] - Max Version - - 1.0 - Min Version +- Enabled following scenarios for REQUIREDSCRIPTS + - [1.0] - RequiredVersion + - [1.0,2.0] - Min and Max Version + - (,1.0] - Max Version + - 1.0 - Min Version Bug fixes * Fixed empty version value in nuspec (#157) @@ -280,8 +280,8 @@ Bug fixes ## For full history of release notes see changelog: https://github.com/PowerShell/PowerShellGet/blob/master/CHANGELOG.md '@ - } } + } - HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=2113539' + HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=2113539' } From 34de033aba1c903c7ae1e34ae60488a837ef1769 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Thu, 3 Mar 2022 16:48:22 -0500 Subject: [PATCH 4/5] Update PowerShellGet.psd1 --- src/PowerShellGet/PowerShellGet.psd1 | 232 +++++++++------------------ 1 file changed, 80 insertions(+), 152 deletions(-) diff --git a/src/PowerShellGet/PowerShellGet.psd1 b/src/PowerShellGet/PowerShellGet.psd1 index 072b5511..9c1a9e5f 100644 --- a/src/PowerShellGet/PowerShellGet.psd1 +++ b/src/PowerShellGet/PowerShellGet.psd1 @@ -1,147 +1,114 @@ @{ - RootModule = 'PSModule.psm1' - ModuleVersion = '2.2.5.1' - GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404' - Author = 'Microsoft Corporation' - CompanyName = 'Microsoft Corporation' - Copyright = '(c) Microsoft Corporation. All rights reserved.' - Description = 'PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts.' - PowerShellVersion = '3.0' - FormatsToProcess = 'PSGet.Format.ps1xml' - FunctionsToExport = @( - 'Find-Command', - 'Find-DSCResource', - 'Find-Module', - 'Find-RoleCapability', - 'Find-Script', - 'Get-CredsFromCredentialProvider', - 'Get-InstalledModule', - 'Get-InstalledScript', - 'Get-PSRepository', - 'Install-Module', - 'Install-Script', - 'New-ScriptFileInfo', - 'Publish-Module', - 'Publish-Script', - 'Register-PSRepository', - 'Save-Module', - 'Save-Script', - 'Set-PSRepository', - 'Test-ScriptFileInfo', - 'Uninstall-Module', - 'Uninstall-Script', - 'Unregister-PSRepository', - 'Update-Module', - 'Update-ModuleManifest', - 'Update-Script', - 'Update-ScriptFileInfo') - - VariablesToExport = 'PSGetPath' - AliasesToExport = @('inmo', 'fimo', 'upmo', 'pumo') - FileList = @('PSModule.psm1', - 'PSGet.Format.ps1xml', - 'PSGet.Resource.psd1') - RequiredModules = @(@{ModuleName = 'PackageManagement'; ModuleVersion = '1.4.4' }) - PrivateData = @{ - "PackageManagementProviders" = 'PSModule.psm1' - "SupportedPowerShellGetFormatVersions" = @('1.x', '2.x') - PSData = @{ - Tags = @('Packagemanagement', - 'Provider', - 'PSEdition_Desktop', - 'PSEdition_Core', - 'Linux', - 'Mac') - ProjectUri = 'https://go.microsoft.com/fwlink/?LinkId=828955' - LicenseUri = 'https://go.microsoft.com/fwlink/?LinkId=829061' - ReleaseNotes = @' + RootModule = 'PSModule.psm1' + ModuleVersion = '2.2.5.1' + GUID = '1d73a601-4a6c-43c5-ba3f-619b18bbb404' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = '(c) Microsoft Corporation. All rights reserved.' + Description = 'PowerShell module with commands for discovering, installing, updating and publishing the PowerShell artifacts like Modules, DSC Resources, Role Capabilities and Scripts.' + PowerShellVersion = '3.0' + FormatsToProcess = 'PSGet.Format.ps1xml' + FunctionsToExport = @( + 'Find-Command', + 'Find-DSCResource', + 'Find-Module', + 'Find-RoleCapability', + 'Find-Script', + 'Get-CredsFromCredentialProvider', + 'Get-InstalledModule', + 'Get-InstalledScript', + 'Get-PSRepository', + 'Install-Module', + 'Install-Script', + 'New-ScriptFileInfo', + 'Publish-Module', + 'Publish-Script', + 'Register-PSRepository', + 'Save-Module', + 'Save-Script', + 'Set-PSRepository', + 'Test-ScriptFileInfo', + 'Uninstall-Module', + 'Uninstall-Script', + 'Unregister-PSRepository', + 'Update-Module', + 'Update-ModuleManifest', + 'Update-Script', + 'Update-ScriptFileInfo') + + VariablesToExport = 'PSGetPath' + AliasesToExport = @('inmo', 'fimo', 'upmo', 'pumo') + FileList = @('PSModule.psm1', + 'PSGet.Format.ps1xml', + 'PSGet.Resource.psd1') + RequiredModules = @(@{ModuleName = 'PackageManagement'; ModuleVersion = '1.4.4' }) + PrivateData = @{ + "PackageManagementProviders" = 'PSModule.psm1' + "SupportedPowerShellGetFormatVersions" = @('1.x', '2.x') + PSData = @{ + Tags = @('Packagemanagement', + 'Provider', + 'PSEdition_Desktop', + 'PSEdition_Core', + 'Linux', + 'Mac') + ProjectUri = 'https://go.microsoft.com/fwlink/?LinkId=828955' + LicenseUri = 'https://go.microsoft.com/fwlink/?LinkId=829061' + ReleaseNotes = @' ### 2.2.5 - Security patch for code injection bug - ### 2.2.4.1 - Remove catalog file - ### 2.2.3 - Update `HelpInfoUri` to point to the latest content (#560) - Improve discovery of usable nuget.exe binary (Thanks bwright86!) (#558) - ### 2.2.2 Bug Fix - - Update casing of DscResources output - ### 2.2.1 Bug Fix - - Allow DscResources to work on case sensitive platforms (#521) - Fix for failure to return credential provider when using private feeds (#521) - ## 2.2 Bug Fix - - Fix for prompting for credentials when passing in -Credential parameter when using Register-PSRepository - ## 2.1.5 New Features - - Add and remove nuget based repositories as a nuget source when nuget client tool is installed (#498) - Bug Fix - - Fix for 'Failed to publish module' error thrown when publishing modules (#497) - ## 2.1.4 - Fixed hang while publishing some packages (#478) - ## 2.1.3 New Features - - Added -Scope parameter to Update-Module (Thanks @lwajswaj!) (#471) - Added -Exclude parameter to Publish-Module (Thanks @Benny1007!) (#191) - Added -SkipAutomaticTags parameter to Publish-Module (Thanks @awickham10!) (#452) - Bug Fix - - Fixed issue with finding modules using macOS and .NET Core 3.0 - ## 2.1.2 - New Feature - - Added support for registering repositories with special characters - ## 2.1.1 - - Fix DSC resource folder structure - ## 2.1.0 - Breaking Change - - Default installation scope for Update-Module and Update-Script has changed to match Install-Module and Install-Script. For Windows PowerShell (version 5.1 or below), the default scope is AllUsers when running in an elevated session, and CurrentUser at all other times. -For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. (#421) - + For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. (#421) Bug Fixes - - Update-ModuleManifest no longer clears FunctionsToExport, AliasesToExport, nor NestModules (#415 & #425) (Thanks @pougetat and @tnieto88!) - Update-Module no longer changes repository URL (#407) - Update-ModuleManifest no longer preprends 'PSGet_' to module name (#403) (Thanks @ThePoShWolf) - Update-ModuleManifest now throws error and fails to update when provided invalid entries (#398) (Thanks @pougetat!) - Ignore files no longer being included when uploading modules (#396) - New Features - - New DSC resource, PSRepository (#426) (Thanks @johlju!) - Piping of PS respositories (#420) - utf8 support for .nuspec (#419) - ## 2.0.4 - Bug Fix * Remove PSGallery availability checks (#374) - ## 2.0.3 - Bug fixes and Improvements * Fix CommandAlreadyAvailable error for PackageManagement module (#333) * Remove trailing whitespace when value is not provided for Get-PSScriptInfoString (#337) (Thanks @thomasrayner) @@ -149,60 +116,44 @@ Bug fixes and Improvements * Improvements for Catalog tests (#343) * Fix Update-ScriptInfoFile to preserve PrivateData (#346) (Thanks @tnieto88) * Import modules with many commands faster (#351) - New Features * Tab completion for -Repository parameter (#339) and for Publish-Module -Name (#359) (Thanks @matt9ucci) - ## 2.0.1 - Bug fixes - Resolved Publish-Module doesn't report error but fails to publish module (#316) - Resolved CommandAlreadyAvailable error while installing the latest version of PackageManagement module (#333) - ## 2.0.0 - Breaking Change - Default installation scope for Install-Module, Install-Script, and Install-Package has changed. For Windows PowerShell (version 5.1 or below), the default scope is AllUsers when running in an elevated session, and CurrentUser at all other times. -For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. - + For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. ## 1.6.7 - Bug fixes - Resolved Install/Save-Module error in PSCore 6.1.0-preview.4 on Ubuntu 18.04 OS (WSL/Azure) (#313) - Updated error message in Save-Module cmdlet when the specified path is not accessible (#313) - Added few additional verbose messages (#313) - ## 1.6.6 - Dependency Updates * Add dependency on version 4.1.0 or newer of NuGet.exe * Update NuGet.exe bootstrap URL to https://aka.ms/psget-nugetexe - Build and Code Cleanup Improvements * Improved error handling in network connectivity tests. - Bug fixes - Change Update-ModuleManifest so that prefix is not added to CmdletsToExport. - Change Update-ModuleManifest so that parameters will not reset to default values. - Specify AllowPrereleseVersions provider option only when AllowPrerelease is specified on the PowerShellGet cmdlets. - ## 1.6.5 - New features * Allow Pester/PSReadline installation when signed by non-Microsoft certificate (#258) -- Whitelist installation of non-Microsoft signed Pester and PSReadline over Microsoft signed Pester and PSReadline. - + - Whitelist installation of non-Microsoft signed Pester and PSReadline over Microsoft signed Pester and PSReadline. Build and Code Cleanup Improvements * Splitting of functions (#229) (Thanks @Benny1007) -- Moves private functions into respective private folder. -- Moves public functions as defined in PSModule.psd1 into respective public folder. -- Removes all functions from PSModule.psm1 file. -- Dot sources the functions from PSModule.psm1 file. -- Uses Export-ModuleMember to export the public functions from PSModule.psm1 file. - + - Moves private functions into respective private folder. + - Moves public functions as defined in PSModule.psd1 into respective public folder. + - Removes all functions from PSModule.psm1 file. + - Dot sources the functions from PSModule.psm1 file. + - Uses Export-ModuleMember to export the public functions from PSModule.psm1 file. * Add build step to construct a single .psm1 file (#242) (Thanks @Benny1007) -- Merged public and private functions into one .psm1 file to increase load time performance. - + - Merged public and private functions into one .psm1 file to increase load time performance. Bug fixes - Fix null parameter error caused by MinimumVersion in Publish-PackageUtility (#201) - Change .ExternalHelp link from PSGet.psm1-help.xml to PSModule-help.xml in PSModule.psm1 file (#215) @@ -211,77 +162,54 @@ Bug fixes - Add positional path to Save-Module and Save-Script (#264, #266) - Ensure that Get-AuthenticodePublisher verifies publisher and that installing or updating a module checks for approprite catalog signature (#272) - Update HelpInfoURI to 'http://go.microsoft.com/fwlink/?linkid=855963' (#274) - - ## 1.6.0 - New features * Prerelease Version Support (#185) -- Implemented prerelease versions functionality in PowerShellGet cmdlets. -- Enables publishing, discovering, and installing the prerelease versions of modules and scripts from the PowerShell Gallery. -- [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/PrereleaseModule) - + - Implemented prerelease versions functionality in PowerShellGet cmdlets. + - Enables publishing, discovering, and installing the prerelease versions of modules and scripts from the PowerShell Gallery. + - [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/PrereleaseModule) * Enabled publish cmdlets on PWSH and Nano Server (#196) -- Dotnet command version 2.0.0 or newer should be installed by the user prior to using the publish cmdlets on PWSH and Windows Nano Server. -- Users can install the dotnet command by following the instructions specified at https://aka.ms/dotnet-install-script. -- On Windows, users can install the dotnet command by running *Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile '.\dotnet-install.ps1'; & '.\dotnet-install.ps1' -Channel Current -Version '2.0.0'* -- Publish cmdlets on Windows PowerShell supports using the dotnet command for publishing operations. - + - Dotnet command version 2.0.0 or newer should be installed by the user prior to using the publish cmdlets on PWSH and Windows Nano Server. + - Users can install the dotnet command by following the instructions specified at https://aka.ms/dotnet-install-script. + - On Windows, users can install the dotnet command by running *Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile '.\dotnet-install.ps1'; & '.\dotnet-install.ps1' -Channel Current -Version '2.0.0'* + - Publish cmdlets on Windows PowerShell supports using the dotnet command for publishing operations. Breaking Change - PWSH: Changed the installation location of AllUsers scope to the parent of $PSHOME instead of $PSHOME. It is the SHARED_MODULES folder on PWSH. - Bug fixes - Update HelpInfoURI to 'https://go.microsoft.com/fwlink/?linkid=855963' (#195) - Ensure MyDocumentsPSPath path is correct (#179) (Thanks @lwsrbrts) - - ## 1.5.0.0 - New features * Added support for modules requiring license acceptance (#150) -- [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/RequireLicenseAcceptance) - + - [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/RequireLicenseAcceptance) * Added version for REQUIREDSCRIPTS (#162) -- Enabled following scenarios for REQUIREDSCRIPTS - - [1.0] - RequiredVersion - - [1.0,2.0] - Min and Max Version - - (,1.0] - Max Version - - 1.0 - Min Version - + - Enabled following scenarios for REQUIREDSCRIPTS + - [1.0] - RequiredVersion + - [1.0,2.0] - Min and Max Version + - (,1.0] - Max Version + - 1.0 - Min Version Bug fixes * Fixed empty version value in nuspec (#157) - - ## 1.1.3.2 * Disabled PowerShellGet Telemetry on PS Core as PowerShell Telemetry APIs got removed in PowerShell Core beta builds. (#153) * Fixed for DateTime format serialization issue. (#141) * Update-ModuleManifest should add ExternalModuleDependencies value as a collection. (#129) - ## 1.1.3.1 - New features * Added `PrivateData` field to ScriptFileInfo. (#119) - Bug fixes - ## 1.1.2.0 - Bug fixes - ## 1.1.1.0 - Bug fixes - ## 1.1.0.0 - * Initial release from GitHub. * PowerShellCore support. - ## For full history of release notes see changelog: https://github.com/PowerShell/PowerShellGet/blob/master/CHANGELOG.md '@ + } } - } - HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=2113539' + HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=2113539' } From 847f571b86aa9b85e3c027d6d8d78a5edde9c836 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Thu, 3 Mar 2022 16:51:42 -0500 Subject: [PATCH 5/5] Update PowerShellGet.psd1 fix unintentional newline changes to powershellget.psd1 file --- src/PowerShellGet/PowerShellGet.psd1 | 72 ++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/src/PowerShellGet/PowerShellGet.psd1 b/src/PowerShellGet/PowerShellGet.psd1 index 9c1a9e5f..02bd7a17 100644 --- a/src/PowerShellGet/PowerShellGet.psd1 +++ b/src/PowerShellGet/PowerShellGet.psd1 @@ -57,58 +57,91 @@ ReleaseNotes = @' ### 2.2.5 - Security patch for code injection bug + ### 2.2.4.1 - Remove catalog file + ### 2.2.3 - Update `HelpInfoUri` to point to the latest content (#560) - Improve discovery of usable nuget.exe binary (Thanks bwright86!) (#558) + ### 2.2.2 Bug Fix + - Update casing of DscResources output + ### 2.2.1 Bug Fix + - Allow DscResources to work on case sensitive platforms (#521) - Fix for failure to return credential provider when using private feeds (#521) + ## 2.2 Bug Fix + - Fix for prompting for credentials when passing in -Credential parameter when using Register-PSRepository + ## 2.1.5 New Features + - Add and remove nuget based repositories as a nuget source when nuget client tool is installed (#498) + Bug Fix + - Fix for 'Failed to publish module' error thrown when publishing modules (#497) + ## 2.1.4 - Fixed hang while publishing some packages (#478) + ## 2.1.3 New Features + - Added -Scope parameter to Update-Module (Thanks @lwajswaj!) (#471) - Added -Exclude parameter to Publish-Module (Thanks @Benny1007!) (#191) - Added -SkipAutomaticTags parameter to Publish-Module (Thanks @awickham10!) (#452) + Bug Fix + - Fixed issue with finding modules using macOS and .NET Core 3.0 + ## 2.1.2 + New Feature + - Added support for registering repositories with special characters + ## 2.1.1 + - Fix DSC resource folder structure + ## 2.1.0 + Breaking Change + - Default installation scope for Update-Module and Update-Script has changed to match Install-Module and Install-Script. For Windows PowerShell (version 5.1 or below), the default scope is AllUsers when running in an elevated session, and CurrentUser at all other times. For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. (#421) + Bug Fixes + - Update-ModuleManifest no longer clears FunctionsToExport, AliasesToExport, nor NestModules (#415 & #425) (Thanks @pougetat and @tnieto88!) - Update-Module no longer changes repository URL (#407) - Update-ModuleManifest no longer preprends 'PSGet_' to module name (#403) (Thanks @ThePoShWolf) - Update-ModuleManifest now throws error and fails to update when provided invalid entries (#398) (Thanks @pougetat!) - Ignore files no longer being included when uploading modules (#396) + New Features + - New DSC resource, PSRepository (#426) (Thanks @johlju!) - Piping of PS respositories (#420) - utf8 support for .nuspec (#419) + ## 2.0.4 + Bug Fix * Remove PSGallery availability checks (#374) + ## 2.0.3 + Bug fixes and Improvements * Fix CommandAlreadyAvailable error for PackageManagement module (#333) * Remove trailing whitespace when value is not provided for Get-PSScriptInfoString (#337) (Thanks @thomasrayner) @@ -116,35 +149,49 @@ Bug fixes and Improvements * Improvements for Catalog tests (#343) * Fix Update-ScriptInfoFile to preserve PrivateData (#346) (Thanks @tnieto88) * Import modules with many commands faster (#351) + New Features * Tab completion for -Repository parameter (#339) and for Publish-Module -Name (#359) (Thanks @matt9ucci) + ## 2.0.1 + Bug fixes - Resolved Publish-Module doesn't report error but fails to publish module (#316) - Resolved CommandAlreadyAvailable error while installing the latest version of PackageManagement module (#333) + ## 2.0.0 + Breaking Change - Default installation scope for Install-Module, Install-Script, and Install-Package has changed. For Windows PowerShell (version 5.1 or below), the default scope is AllUsers when running in an elevated session, and CurrentUser at all other times. For PowerShell version 6.0.0 and above, the default installation scope is always CurrentUser. + ## 1.6.7 + Bug fixes - Resolved Install/Save-Module error in PSCore 6.1.0-preview.4 on Ubuntu 18.04 OS (WSL/Azure) (#313) - Updated error message in Save-Module cmdlet when the specified path is not accessible (#313) - Added few additional verbose messages (#313) + ## 1.6.6 + Dependency Updates * Add dependency on version 4.1.0 or newer of NuGet.exe * Update NuGet.exe bootstrap URL to https://aka.ms/psget-nugetexe + Build and Code Cleanup Improvements * Improved error handling in network connectivity tests. + Bug fixes - Change Update-ModuleManifest so that prefix is not added to CmdletsToExport. - Change Update-ModuleManifest so that parameters will not reset to default values. - Specify AllowPrereleseVersions provider option only when AllowPrerelease is specified on the PowerShellGet cmdlets. + ## 1.6.5 + New features * Allow Pester/PSReadline installation when signed by non-Microsoft certificate (#258) - Whitelist installation of non-Microsoft signed Pester and PSReadline over Microsoft signed Pester and PSReadline. + Build and Code Cleanup Improvements * Splitting of functions (#229) (Thanks @Benny1007) - Moves private functions into respective private folder. @@ -152,8 +199,10 @@ Build and Code Cleanup Improvements - Removes all functions from PSModule.psm1 file. - Dot sources the functions from PSModule.psm1 file. - Uses Export-ModuleMember to export the public functions from PSModule.psm1 file. + * Add build step to construct a single .psm1 file (#242) (Thanks @Benny1007) - Merged public and private functions into one .psm1 file to increase load time performance. + Bug fixes - Fix null parameter error caused by MinimumVersion in Publish-PackageUtility (#201) - Change .ExternalHelp link from PSGet.psm1-help.xml to PSModule-help.xml in PSModule.psm1 file (#215) @@ -162,49 +211,72 @@ Bug fixes - Add positional path to Save-Module and Save-Script (#264, #266) - Ensure that Get-AuthenticodePublisher verifies publisher and that installing or updating a module checks for approprite catalog signature (#272) - Update HelpInfoURI to 'http://go.microsoft.com/fwlink/?linkid=855963' (#274) + + ## 1.6.0 + New features * Prerelease Version Support (#185) - Implemented prerelease versions functionality in PowerShellGet cmdlets. - Enables publishing, discovering, and installing the prerelease versions of modules and scripts from the PowerShell Gallery. - [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/PrereleaseModule) + * Enabled publish cmdlets on PWSH and Nano Server (#196) - Dotnet command version 2.0.0 or newer should be installed by the user prior to using the publish cmdlets on PWSH and Windows Nano Server. - Users can install the dotnet command by following the instructions specified at https://aka.ms/dotnet-install-script. - On Windows, users can install the dotnet command by running *Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -OutFile '.\dotnet-install.ps1'; & '.\dotnet-install.ps1' -Channel Current -Version '2.0.0'* - Publish cmdlets on Windows PowerShell supports using the dotnet command for publishing operations. + Breaking Change - PWSH: Changed the installation location of AllUsers scope to the parent of $PSHOME instead of $PSHOME. It is the SHARED_MODULES folder on PWSH. + Bug fixes - Update HelpInfoURI to 'https://go.microsoft.com/fwlink/?linkid=855963' (#195) - Ensure MyDocumentsPSPath path is correct (#179) (Thanks @lwsrbrts) + + ## 1.5.0.0 + New features * Added support for modules requiring license acceptance (#150) - [Documentation](https://docs.microsoft.com/en-us/powershell/gallery/psget/module/RequireLicenseAcceptance) + * Added version for REQUIREDSCRIPTS (#162) - Enabled following scenarios for REQUIREDSCRIPTS - [1.0] - RequiredVersion - [1.0,2.0] - Min and Max Version - (,1.0] - Max Version - 1.0 - Min Version + Bug fixes * Fixed empty version value in nuspec (#157) + + ## 1.1.3.2 * Disabled PowerShellGet Telemetry on PS Core as PowerShell Telemetry APIs got removed in PowerShell Core beta builds. (#153) * Fixed for DateTime format serialization issue. (#141) * Update-ModuleManifest should add ExternalModuleDependencies value as a collection. (#129) + ## 1.1.3.1 + New features * Added `PrivateData` field to ScriptFileInfo. (#119) + Bug fixes + ## 1.1.2.0 + Bug fixes + ## 1.1.1.0 + Bug fixes + ## 1.1.0.0 + * Initial release from GitHub. * PowerShellCore support. + ## For full history of release notes see changelog: https://github.com/PowerShell/PowerShellGet/blob/master/CHANGELOG.md '@