From b0b3ebfc33de6730bfe748a65a1baefa9ee17a1b Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Tue, 4 Jan 2022 15:16:13 -0500 Subject: [PATCH 01/10] add files/folders needed for build --- .ci/ci.yml | 136 + .ci/ci_auto.yml | 331 ++ .ci/ci_release.yml | 350 ++ .ci/release.yml | 36 + .ci/test.yml | 98 + .github/ISSUE_TEMPLATE/Bug_Report.yaml | 73 + .github/ISSUE_TEMPLATE/Feature_Request.yaml | 20 + .github/ISSUE_TEMPLATE/config.yml | 5 + .github/PULL_REQUEST_TEMPLATE.md | 36 + .github/workflows/codeql-analysis.yml | 62 + .gitignore | 5 + CHANGELOG.md | 161 + ..._InstallModuleWithinVersionRangeConfig.ps1 | 4 +- Notice.txt | 2025 +++++++++ bootstrap.ps1 | 127 + build.ps1 | 117 + doBuild.ps1 | 123 + help/Find-PSResource.md | 320 ++ help/Get-PSResource.md | 153 + help/Get-PSResourceRepository.md | 102 + help/Install-PSResource.md | 325 ++ help/PowerShellGet.md | 46 + help/Publish-PSResource.md | 175 + help/Register-PSResourceRepository.md | 232 + help/Save-PSResource.md | 304 ++ help/Set-PSResourceRepository.md | 200 + help/Uninstall-PSResource.md | 142 + help/Unregister-PSResourceRepository.md | 131 + help/Update-PSResource.md | 284 ++ help/en-US/PowerShellGet.dll-Help.xml | 4041 +++++++++++++++++ nuget.config | 10 + pspackageproject.json | 9 + .../MSFT_PSModule/MSFT_PSModule.psm1 | 625 +++ .../MSFT_PSModule/MSFT_PSModule.schema.mfl | 21 + .../MSFT_PSModule/MSFT_PSModule.schema.mof | 19 + .../en-US/MSFT_PSModule.strings.psd1 | 35 + .../MSFT_PSRepository/MSFT_PSRepository.psm1 | 273 ++ .../MSFT_PSRepository.schema.mfl | 15 + .../MSFT_PSRepository.schema.mof | 11 + .../en-US/MSFT_PSRepository.strings.psd1 | 22 + .../PowerShellGet.LocalizationHelper.psm1 | 254 ++ .../PowerShellGet.ResourceHelper.psm1 | 368 ++ .../PowerShellGet.ResourceHelper.strings.psd1 | 29 + .../MSFT_PSModule.Integration.Tests.ps1 | 0 .../Integration/MSFT_PSModule.config.ps1 | 0 .../MSFT_PSRepository.Integration.Tests.ps1 | 0 .../Integration/MSFT_PSRepository.config.ps1 | 0 {Tests => test}/Unit/MSFT_PSModule.Tests.ps1 | 0 .../Unit/MSFT_PSRepository.Tests.ps1 | 0 ...PowerShellGet.LocalizationHelper.Tests.ps1 | 0 .../PowerShellGet.ResourceHelper.Tests.ps1 | 0 51 files changed, 11853 insertions(+), 2 deletions(-) create mode 100644 .ci/ci.yml create mode 100644 .ci/ci_auto.yml create mode 100644 .ci/ci_release.yml create mode 100644 .ci/release.yml create mode 100644 .ci/test.yml create mode 100644 .github/ISSUE_TEMPLATE/Bug_Report.yaml create mode 100644 .github/ISSUE_TEMPLATE/Feature_Request.yaml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 Notice.txt create mode 100644 bootstrap.ps1 create mode 100644 build.ps1 create mode 100644 doBuild.ps1 create mode 100644 help/Find-PSResource.md create mode 100644 help/Get-PSResource.md create mode 100644 help/Get-PSResourceRepository.md create mode 100644 help/Install-PSResource.md create mode 100644 help/PowerShellGet.md create mode 100644 help/Publish-PSResource.md create mode 100644 help/Register-PSResourceRepository.md create mode 100644 help/Save-PSResource.md create mode 100644 help/Set-PSResourceRepository.md create mode 100644 help/Uninstall-PSResource.md create mode 100644 help/Unregister-PSResourceRepository.md create mode 100644 help/Update-PSResource.md create mode 100644 help/en-US/PowerShellGet.dll-Help.xml create mode 100644 nuget.config create mode 100644 pspackageproject.json create mode 100644 src/code/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 create mode 100644 src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl create mode 100644 src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof create mode 100644 src/code/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 create mode 100644 src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 create mode 100644 src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl create mode 100644 src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof create mode 100644 src/code/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 create mode 100644 src/code/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 create mode 100644 src/code/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 create mode 100644 src/code/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 rename {Tests => test}/Integration/MSFT_PSModule.Integration.Tests.ps1 (100%) rename {Tests => test}/Integration/MSFT_PSModule.config.ps1 (100%) rename {Tests => test}/Integration/MSFT_PSRepository.Integration.Tests.ps1 (100%) rename {Tests => test}/Integration/MSFT_PSRepository.config.ps1 (100%) rename {Tests => test}/Unit/MSFT_PSModule.Tests.ps1 (100%) rename {Tests => test}/Unit/MSFT_PSRepository.Tests.ps1 (100%) rename {Tests => test}/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 (100%) rename {Tests => test}/Unit/PowerShellGet.ResourceHelper.Tests.ps1 (100%) diff --git a/.ci/ci.yml b/.ci/ci.yml new file mode 100644 index 0000000..7728cf1 --- /dev/null +++ b/.ci/ci.yml @@ -0,0 +1,136 @@ +name: $(BuildDefinitionName)-$(date:yyMM).$(date:dd)$(rev:rrr) +trigger: + # Batch merge builds together while a merge build is running + batch: true + branches: + include: + - master +pr: + branches: + include: + - master + +resources: + repositories: + - repository: ComplianceRepo + type: github + endpoint: ComplianceGHRepo + name: PowerShell/compliance + +stages: +- stage: Build + displayName: Build PowerShellGet Module Package + jobs: + - job: BuildPkg + displayName: Build Package + pool: + vmImage: windows-latest + + steps: + + - pwsh: | + Get-ChildItem -Path env: + Get-ChildItem -Path env: + displayName: Capture environment for build + condition: succeededOrFailed() + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + if (Test-Path -Path $modulePath) { + Write-Verbose -Verbose "Deleting existing temp module path: $modulePath" + Remove-Item -Path $modulePath -Recurse -Force -ErrorAction Ignore + } + if (! (Test-Path -Path $modulePath)) { + Write-Verbose -Verbose "Creating new temp module path: $modulePath" + $null = New-Item -Path $modulePath -ItemType Directory + } + displayName: Create temporary module path + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + Write-Verbose -Verbose "Install PowerShellGet V3 to temp module path" + Save-Module -Name PowerShellGet -Path $modulePath -MinimumVersion 3.0.0-beta10 -AllowPrerelease -Force + Write-Verbose -Verbose "Install PlatyPS to temp module path" + Save-Module -Name "platyPS" -Path $modulePath -Force + Write-Verbose -Verbose "Install PSScriptAnalyzer to temp module path" + Save-Module -Name "PSScriptAnalyzer" -Path $modulePath -RequiredVersion 1.18.0 -Force + Write-Verbose -Verbose "Install Pester 4.X to temp module path" + Save-Module -Name "Pester" -MaximumVersion 4.99 -Path $modulePath -Force + Write-Verbose -Verbose "Install PSPackageProject to temp module path" + Save-Module -Name PSPackageProject -Path $modulePath -Force + displayName: Install PSPackageProject and dependencies + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + # + # Build for netstandard2.0 framework + $(Build.SourcesDirectory)/build.ps1 -Build -Clean -BuildConfiguration Release -BuildFramework 'netstandard2.0' + displayName: Build and publish artifact + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + $config = Get-PSPackageProjectConfiguration + # + $srcModulePath = Resolve-Path -Path "$($config.BuildOutputPath)/$($config.ModuleName)" + Get-ChildItem $srcModulePath + $artifactName = "$($config.ModuleName)" + Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$srcModulePath" + # + $(Build.SourcesDirectory)/build.ps1 -Publish + displayName: Create module artifact + +- stage: Compliance + displayName: Compliance + dependsOn: Build + jobs: + - job: ComplianceJob + pool: + vmImage: windows-latest + steps: + - checkout: self + clean: true + - checkout: ComplianceRepo + clean: true + - download: current + artifact: 'PowerShellGet' + - template: ci-compliance.yml@ComplianceRepo + parameters: + # credscan + suppressionsFile: '' + +- stage: Test + displayName: Test Package + dependsOn: Build + jobs: + - template: test.yml + parameters: + jobName: TestPkgWin + displayName: PowerShell Core on Windows + imageName: windows-latest + + - template: test.yml + parameters: + jobName: TestPkgWinPS + displayName: Windows PowerShell on Windows + imageName: windows-latest + powershellExecutable: powershell + + - template: test.yml + parameters: + jobName: TestPkgUbuntu + displayName: PowerShell Core on Ubuntu + imageName: ubuntu-latest + + - template: test.yml + parameters: + jobName: TestPkgWinMacOS + displayName: PowerShell Core on macOS + imageName: macOS-latest diff --git a/.ci/ci_auto.yml b/.ci/ci_auto.yml new file mode 100644 index 0000000..658f10a --- /dev/null +++ b/.ci/ci_auto.yml @@ -0,0 +1,331 @@ +name: $(BuildDefinitionName)-$(date:yyMM).$(date:dd)$(rev:rrr) +trigger: none +pr: none + +schedules: +# Use https://crontab.guru/#0_8_*_*_* to compute crontab expression +# Temporary schedule to run every 30 minutes, to investigate test failures +# - cron: "*/30 * * * *" +# Run signed build, with limited signing cert, every day at 9 am +- cron: 0 9 * * * + branches: + include: + - refs/heads/master + always: true + +variables: + - group: ESRP + +resources: + repositories: + - repository: ComplianceRepo + type: github + endpoint: ComplianceGHRepo + name: PowerShell/compliance + +stages: +- stage: Build + displayName: Build PowerShellGet Module Package + jobs: + - job: BuildPkg + displayName: Build Package + pool: + name: 1ES + demands: + - ImageOverride -equals MMS2019 + + steps: + + - pwsh: | + Get-ChildItem -Path env: + Get-ChildItem -Path env: + displayName: Capture environment for build + condition: succeededOrFailed() + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + if (Test-Path -Path $modulePath) { + Write-Verbose -Verbose "Deleting existing temp module path: $modulePath" + Remove-Item -Path $modulePath -Recurse -Force -ErrorAction Ignore + } + if (! (Test-Path -Path $modulePath)) { + Write-Verbose -Verbose "Creating new temp module path: $modulePath" + $null = New-Item -Path $modulePath -ItemType Directory + } + displayName: Create temporary module path + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + Write-Verbose -Verbose "Install PowerShellGet V3 to temp module path" + Save-Module -Name PowerShellGet -Path $modulePath -MinimumVersion 3.0.0-beta10 -AllowPrerelease -Force + Write-Verbose -Verbose "Install PlatyPS to temp module path" + Save-Module -Name "platyPS" -Path $modulePath -Force + Write-Verbose -Verbose "Install PSScriptAnalyzer to temp module path" + Save-Module -Name "PSScriptAnalyzer" -Path $modulePath -RequiredVersion 1.18.0 -Force + Write-Verbose -Verbose "Install Pester 5.X to temp module path" + Save-Module -Name "Pester" -MinimumVersion 5.0 -Path $modulePath -Repository PSGallery -Force + Write-Verbose -Verbose "Install PSPackageProject to temp module path" + Save-Module -Name PSPackageProject -Path $modulePath -Force + displayName: Install PSPackageProject and dependencies + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + # + # Build for netstandard2.0 framework + $(Build.SourcesDirectory)/build.ps1 -Build -Clean -BuildConfiguration Release -BuildFramework 'netstandard2.0' + displayName: Build and publish artifact + + - pwsh: | + $signSrcPath = "$($config.BuildOutputPath)" + $vstsCommandString = "vso[task.setvariable variable=signSrcPath]${signSrcPath}" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + # + $outSignPath = "$($config.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: succeeded() + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + + $config = Get-PSPackageProjectConfiguration + + # Created files signing directory + $srcPath = "$($config.BuildOutputPath)\$($config.ModuleName)" + $createdSignSrcPath = "$($config.BuildOutputPath)\CreatedFiles" + if (! (Test-Path -Path $createdSignSrcPath)) { + $null = New-Item -Path $createdSignSrcPath -ItemType Directory -Verbose + } + Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "PowerShellGet.psd1") -Dest $createdSignSrcPath -Force -Verbose + Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "PSGet.Format.ps1xml") -Dest $createdSignSrcPath -Force -Verbose + + $netStandardPath = Join-Path -Path $createdSignSrcPath -ChildPath "netstandard2.0" + if (! (Test-Path -Path $netStandardPath)) { + $null = New-Item -Path $netStandardPath -ItemType Directory -Verbose + } + Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "netstandard2.0\PowerShellGet.*") -Dest $netStandardPath -Force -Verbose + + $signOutPath = "$($config.SignedOutputPath)\$($config.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" + + $outSignPath = "$($config.SignedOutputPath)\$($config.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: Set up for module created files code signing + condition: succeeded() + + - pwsh: | + Get-ChildItem -Path env: + Get-ChildItem -Path . -Recurse -Directory + displayName: Capture environment for code signing + condition: succeededOrFailed() + + - template: EsrpSign.yml@ComplianceRepo + parameters: + buildOutputPath: $(signSrcPath) + signOutputPath: $(signOutPath) + certificateId: "CP-460906" + shouldSign: $(ShouldSign) + pattern: | + **\*.dll + **\*.psd1 + **\*.psm1 + **\*.ps1xml + **\*.mof + useMinimatch: true + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + + $config = Get-PSPackageProjectConfiguration + + $signOutPath = "$($config.SignedOutputPath)\$($config.ModuleName)" + if (! (Test-Path -Path $signOutPath)) { + $null = New-Item -Path $signOutPath -ItemType Directory + } + + # Third party files signing directory + $srcPath = "$($config.BuildOutputPath)\$($config.ModuleName)" + $thirdPartySignSrcPath = "$($config.BuildOutputPath)\ThirdParty" + if (! (Test-Path -Path $thirdPartySignSrcPath)) { + $null = New-Item -Path $thirdPartySignSrcPath -ItemType Directory -Verbose + } + + # NetStandard directory + $netStandardPath = Join-Path -Path $thirdPartySignSrcPath -ChildPath "netstandard2.0" + if (! (Test-Path -Path $netStandardPath)) { + $null = New-Item -Path $netStandardPath -ItemType Directory -Verbose + } + Get-ChildItem -Path (Join-Path -Path $srcPath -ChildPath "netstandard2.0") -Filter '*.dll' | Foreach-Object { + if ($_.Name -ne 'PowerShellGet.dll') { + $sig = Get-AuthenticodeSignature -FilePath $_.FullName + if ($sig.Status -ne 'Valid' -or $sig.SignerCertificate.Subject -notlike '*Microsoft*' -or $sig.SignerCertificate.Issuer -notlike '*Microsoft Code Signing PCA*') { + # Copy for third party signing + Copy-Item -Path $_.FullName -Dest $netStandardPath -Force -Verbose + } + } + } + + # Set signing src path variable + $vstsCommandString = "vso[task.setvariable variable=signSrcPath]${thirdPartySignSrcPath}" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + + # Set signing out path variable + $vstsCommandString = "vso[task.setvariable variable=signOutPath]${signOutPath}" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + displayName: Set up for module third party files code signing + condition: succeeded() + + - template: EsrpSign.yml@ComplianceRepo + parameters: + buildOutputPath: $(signSrcPath) + signOutputPath: $(signOutPath) + certificateId: "CP-231522" + shouldSign: $(ShouldSign) + pattern: | + **\*.dll + useMinimatch: true + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + + $config = Get-PSPackageProjectConfiguration + + $srcPath = "$($config.BuildOutputPath)\$($config.ModuleName)" + $signOutPath = "$($config.SignedOutputPath)\$($config.ModuleName)" + if (! (Test-Path -Path $signOutPath)) { + $null = New-Item -Path $signOutPath -ItemType Directory + } + + # en-US + Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "en-US") -Dest $signOutPath -Recurse + + # NetStandard directory + $netStandardSignedOutPath = Join-Path -Path $signOutPath -ChildPath "netstandard2.0" + if (! (Test-Path -Path $netStandardSignedOutPath)) { + $null = New-Item -Path $netStandardSignedOutPath -ItemType Directory -Verbose + } + Get-ChildItem -Path (Join-Path -Path $srcPath -ChildPath "netstandard2.0") -Filter '*.dll' | Foreach-Object { + if ($_.Name -ne 'PowerShellGet.dll') { + $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 $netStandardSignedOutPath -Force -Verbose + } + } + } + displayName: Copy already properly signed third party files + condition: succeeded() + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + # + $config = Get-PSPackageProjectConfiguration + $artifactName = "$($config.ModuleName)" + $srcModulePath = Resolve-Path -Path "$($config.SignedOutputPath)/$($config.ModuleName)" + Get-ChildItem $srcModulePath + Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$srcModulePath" + # + $(Build.SourcesDirectory)/build.ps1 -Publish -Signed + displayName: Create signed module artifact + +- stage: Compliance + displayName: Compliance + dependsOn: Build + jobs: + - job: ComplianceJob + pool: + name: 1ES + demands: + - ImageOverride -equals MMS2019 + + steps: + - checkout: self + clean: true + - checkout: ComplianceRepo + clean: true + - download: current + artifact: 'PowerShellGet' + - template: assembly-module-compliance.yml@ComplianceRepo + parameters: + # binskim + AnalyzeTarget: '$(Pipeline.Workspace)/PowerShellGet/netstandard2.0/PowerShellGet.dll' + AnalyzeSymPath: 'SRV*' + # component-governance + sourceScanPath: '$(Build.SourcesDirectory)' + # credscan + suppressionsFile: '' + # TermCheck + optionsRulesDBPath: '' + optionsFTPath: '' + # tsa-upload + codeBaseName: 'PowerShellGet_210306' + # selections + APIScan: false # set to false when not using Windows APIs + +- stage: Test + displayName: Test Package + dependsOn: Build + jobs: + - template: test.yml + parameters: + jobName: TestPkgWin + displayName: PowerShell Core on Windows + imageName: windows-latest + + - template: test.yml + parameters: + jobName: TestPkgWinPS + displayName: Windows PowerShell on Windows + imageName: windows-latest + powershellExecutable: powershell + + - template: test.yml + parameters: + jobName: TestPkgUbuntu + displayName: PowerShell Core on Ubuntu + imageName: ubuntu-latest + + - template: test.yml + parameters: + jobName: TestPkgWinMacOS + displayName: PowerShell Core on macOS + imageName: macOS-latest diff --git a/.ci/ci_release.yml b/.ci/ci_release.yml new file mode 100644 index 0000000..ce6a619 --- /dev/null +++ b/.ci/ci_release.yml @@ -0,0 +1,350 @@ +name: $(BuildDefinitionName)-$(date:yyMM).$(date:dd)$(rev:rrr) +trigger: none +pr: none + +variables: + - group: ESRP + +resources: + repositories: + - repository: ComplianceRepo + type: github + endpoint: ComplianceGHRepo + name: PowerShell/compliance + +stages: +- stage: Build + displayName: Build PowerShellGet Module Package + jobs: + - job: BuildPkg + displayName: Build Package + pool: + name: 1ES + demands: + - ImageOverride -equals MMS2019 + + steps: + + - pwsh: | + Get-ChildItem -Path env: + Get-ChildItem -Path env: + displayName: Capture environment for build + condition: succeededOrFailed() + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + if (Test-Path -Path $modulePath) { + Write-Verbose -Verbose "Deleting existing temp module path: $modulePath" + Remove-Item -Path $modulePath -Recurse -Force -ErrorAction Ignore + } + if (! (Test-Path -Path $modulePath)) { + Write-Verbose -Verbose "Creating new temp module path: $modulePath" + $null = New-Item -Path $modulePath -ItemType Directory + } + displayName: Create temporary module path + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + Write-Verbose -Verbose "Install PowerShellGet V3 to temp module path" + Save-Module -Name PowerShellGet -Path $modulePath -MinimumVersion 3.0.0-beta10 -AllowPrerelease -Force + Write-Verbose -Verbose "Install PlatyPS to temp module path" + Save-Module -Name "platyPS" -Path $modulePath -Force + Write-Verbose -Verbose "Install PSScriptAnalyzer to temp module path" + Save-Module -Name "PSScriptAnalyzer" -Path $modulePath -RequiredVersion 1.18.0 -Force + Write-Verbose -Verbose "Install Pester 5.X to temp module path" + Save-Module -Name "Pester" -MinimumVersion 5.0 -Path $modulePath -Repository PSGallery -Force + Write-Verbose -Verbose "Install PSPackageProject to temp module path" + Save-Module -Name PSPackageProject -Path $modulePath -Force + displayName: Install PSPackageProject and dependencies + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + # + # Build for netstandard2.0 framework + $(Build.SourcesDirectory)/build.ps1 -Build -Clean -BuildConfiguration Release -BuildFramework 'netstandard2.0' + displayName: Build and publish artifact + + - pwsh: | + $signSrcPath = "$($config.BuildOutputPath)" + $vstsCommandString = "vso[task.setvariable variable=signSrcPath]${signSrcPath}" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + # + $outSignPath = "$($config.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: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + + $config = Get-PSPackageProjectConfiguration + + # Created files signing directory + $srcPath = "$($config.BuildOutputPath)\$($config.ModuleName)" + $createdSignSrcPath = "$($config.BuildOutputPath)\CreatedFiles" + if (! (Test-Path -Path $createdSignSrcPath)) { + $null = New-Item -Path $createdSignSrcPath -ItemType Directory -Verbose + } + Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "PowerShellGet.psd1") -Dest $createdSignSrcPath -Force -Verbose + Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "PSGet.Format.ps1xml") -Dest $createdSignSrcPath -Force -Verbose + + $netStandardPath = Join-Path -Path $createdSignSrcPath -ChildPath "netstandard2.0" + if (! (Test-Path -Path $netStandardPath)) { + $null = New-Item -Path $netStandardPath -ItemType Directory -Verbose + } + Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "netstandard2.0\PowerShellGet.*") -Dest $netStandardPath -Force -Verbose + + $signOutPath = "$($config.SignedOutputPath)\$($config.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" + + $outSignPath = "$($config.SignedOutputPath)\$($config.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: Set up for module created files code signing + condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), ne(variables['SkipSigning'], 'True')) + + - pwsh: | + Get-ChildItem -Path env: + Get-ChildItem -Path . -Recurse -Directory + displayName: Capture environment for code signing + condition: succeededOrFailed() + + - template: EsrpSign.yml@ComplianceRepo + parameters: + buildOutputPath: $(signSrcPath) + signOutputPath: $(signOutPath) + certificateId: "CP-230012" + pattern: | + **\*.dll + **\*.psd1 + **\*.psm1 + **\*.ps1xml + **\*.mof + useMinimatch: true + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + + $config = Get-PSPackageProjectConfiguration + + $signOutPath = "$($config.SignedOutputPath)\$($config.ModuleName)" + if (! (Test-Path -Path $signOutPath)) { + $null = New-Item -Path $signOutPath -ItemType Directory + } + + # Third party files signing directory + $srcPath = "$($config.BuildOutputPath)\$($config.ModuleName)" + $thirdPartySignSrcPath = "$($config.BuildOutputPath)\ThirdParty" + if (! (Test-Path -Path $thirdPartySignSrcPath)) { + $null = New-Item -Path $thirdPartySignSrcPath -ItemType Directory -Verbose + } + + # NetStandard directory + $netStandardPath = Join-Path -Path $thirdPartySignSrcPath -ChildPath "netstandard2.0" + if (! (Test-Path -Path $netStandardPath)) { + $null = New-Item -Path $netStandardPath -ItemType Directory -Verbose + } + Get-ChildItem -Path (Join-Path -Path $srcPath -ChildPath "netstandard2.0") -Filter '*.dll' | Foreach-Object { + if ($_.Name -ne 'PowerShellGet.dll') { + $sig = Get-AuthenticodeSignature -FilePath $_.FullName + if ($sig.Status -ne 'Valid' -or $sig.SignerCertificate.Subject -notlike '*Microsoft*' -or $sig.SignerCertificate.Issuer -notlike '*Microsoft Code Signing PCA*') { + # Copy for third party signing + Copy-Item -Path $_.FullName -Dest $netStandardPath -Force -Verbose + } + } + } + + # Set signing src path variable + $vstsCommandString = "vso[task.setvariable variable=signSrcPath]${thirdPartySignSrcPath}" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + + # Set signing out path variable + $vstsCommandString = "vso[task.setvariable variable=signOutPath]${signOutPath}" + Write-Host "sending " + $vstsCommandString + Write-Host "##$vstsCommandString" + displayName: Set up for module third party files code signing + condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), ne(variables['SkipSigning'], 'True')) + + - template: EsrpSign.yml@ComplianceRepo + parameters: + buildOutputPath: $(signSrcPath) + signOutputPath: $(signOutPath) + certificateId: "CP-231522" + pattern: | + **\*.dll + useMinimatch: true + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + + $config = Get-PSPackageProjectConfiguration + + $srcPath = "$($config.BuildOutputPath)\$($config.ModuleName)" + $signOutPath = "$($config.SignedOutputPath)\$($config.ModuleName)" + if (! (Test-Path -Path $signOutPath)) { + $null = New-Item -Path $signOutPath -ItemType Directory + } + + # en-US + Copy-Item -Path (Join-Path -Path $srcPath -ChildPath "en-US") -Dest $signOutPath -Recurse + + # NetStandard directory + $netStandardSignedOutPath = Join-Path -Path $signOutPath -ChildPath "netstandard2.0" + if (! (Test-Path -Path $netStandardSignedOutPath)) { + $null = New-Item -Path $netStandardSignedOutPath -ItemType Directory -Verbose + } + Get-ChildItem -Path (Join-Path -Path $srcPath -ChildPath "netstandard2.0") -Filter '*.dll' | Foreach-Object { + if ($_.Name -ne 'PowerShellGet.dll') { + $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 $netStandardSignedOutPath -Force -Verbose + } + } + } + displayName: Copy already properly signed third party files + 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/powershellget' + PackageName: 'PowerShellGet' + PackageVersion: '3.0.12' + + - pwsh: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + # + $config = Get-PSPackageProjectConfiguration + $artifactName = "$($config.ModuleName)" + if ($env:SkipSigning -eq 'True') + { + $srcModulePath = Resolve-Path -Path "$($config.BuildOutputPath)/$($config.ModuleName)" + Get-ChildItem $srcModulePath + Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$srcModulePath" + # + $(Build.SourcesDirectory)/build.ps1 -Publish + } + else + { + $srcModulePath = Resolve-Path -Path "$($config.SignedOutputPath)/$($config.ModuleName)" + Get-ChildItem $srcModulePath + Write-Host "##vso[artifact.upload containerfolder=$artifactName;artifactname=$artifactName;]$srcModulePath" + # + $(Build.SourcesDirectory)/build.ps1 -Publish -Signed + } + displayName: Create module artifact + +- stage: Compliance + displayName: Compliance + dependsOn: Build + jobs: + - job: ComplianceJob + pool: + name: 1ES + demands: + - ImageOverride -equals MMS2019 + + steps: + - checkout: self + clean: true + - checkout: ComplianceRepo + clean: true + - download: current + artifact: 'PowerShellGet' + - template: assembly-module-compliance.yml@ComplianceRepo + parameters: + # binskim + AnalyzeTarget: '$(Pipeline.Workspace)/PowerShellGet/netstandard2.0/PowerShellGet.dll' + AnalyzeSymPath: 'SRV*' + # component-governance + sourceScanPath: '$(Build.SourcesDirectory)' + # credscan + suppressionsFile: '' + # TermCheck + optionsRulesDBPath: '' + optionsFTPath: '' + # tsa-upload + codeBaseName: 'PowerShellGet_210306' + # selections + APIScan: false # set to false when not using Windows APIs + # Generate the third party notice file after component detection + - task: msospo.ospo-extension.8d7f9abb-6896-461d-9e25-4f74ed65ddb2.notice@0 + displayName: 'Third Party Notice File Generator' + inputs: + outputfile: ThirdPartyNotice + # output format can be html or text + outputformat: text + +- stage: Test + displayName: Test Package + dependsOn: Build + jobs: + - template: test.yml + parameters: + jobName: TestPkgWin + displayName: PowerShell Core on Windows + imageName: windows-latest + + - template: test.yml + parameters: + jobName: TestPkgWinPS + displayName: Windows PowerShell on Windows + imageName: windows-latest + powershellExecutable: powershell + + - template: test.yml + parameters: + jobName: TestPkgUbuntu + displayName: PowerShell Core on Ubuntu + imageName: ubuntu-latest + + - template: test.yml + parameters: + jobName: TestPkgWinMacOS + displayName: PowerShell Core on macOS + imageName: macOS-latest + +- stage: Release + displayName: Publish Package to PSGallery + condition: and(and(succeeded(), eq(variables['Build.Reason'], 'Manual')), eq(variables['Publish'], 'True')) + jobs: + - template: release.yml diff --git a/.ci/release.yml b/.ci/release.yml new file mode 100644 index 0000000..6c85279 --- /dev/null +++ b/.ci/release.yml @@ -0,0 +1,36 @@ +parameters: + jobName: release + displayName: 'Release PowerShellGet to PSGallery' + +jobs: +- job: ${{ parameters.jobName }} + pool: + name: 1ES + demands: + - ImageOverride -equals MMS2019 + displayName: ${{ parameters.displayName }} + + steps: + + - task: DownloadPipelineArtifact@2 + displayName: 'Download PowerShellGet module artifacts' + inputs: + artifact: nupkg + patterns: '**/*.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 diff --git a/.ci/test.yml b/.ci/test.yml new file mode 100644 index 0000000..aa14166 --- /dev/null +++ b/.ci/test.yml @@ -0,0 +1,98 @@ +parameters: + jobName: TestPkgWin + imageName: windows-latest + displayName: PowerShell Core on Windows + powershellExecutable: pwsh + +jobs: +- job: ${{ parameters.jobName }} + pool: + vmImage: ${{ parameters.imageName }} + displayName: ${{ parameters.displayName }} + steps: + - task: DownloadBuildArtifacts@0 + displayName: 'Download artifacts' + inputs: + buildType: current + downloadType: specific + itemPattern: '**/*.nupkg' + downloadPath: '$(System.ArtifactsDirectory)' + + - ${{ parameters.powershellExecutable }}: | + Get-ChildItem -Path "$(System.ArtifactsDirectory)" + displayName: Capture artifacts directory + + - ${{ parameters.powershellExecutable }}: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + if (Test-Path -Path $modulePath) { + Write-Verbose -Verbose "Deleting existing temp module path: $modulePath" + Remove-Item -Path $modulePath -Recurse -Force -ErrorAction Ignore + } + if (! (Test-Path -Path $modulePath)) { + Write-Verbose -Verbose "Creating new temp module path: $modulePath" + $null = New-Item -Path $modulePath -ItemType Directory + } + displayName: Create temporary module path + + - ${{ parameters.powershellExecutable }}: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + Write-Verbose -Verbose "Install PowerShellGet V3 to temp module path" + Save-Module -Name PowerShellGet -Path $modulePath -MinimumVersion 3.0.0-beta10 -AllowPrerelease -Force + Write-Verbose -Verbose "Install PlatyPS to temp module path" + Save-Module -Name "platyPS" -Path $modulePath -Force + Write-Verbose -Verbose "Install PSScriptAnalyzer to temp module path" + Save-Module -Name "PSScriptAnalyzer" -Path $modulePath -RequiredVersion 1.18.0 -Force + Write-Verbose -Verbose "Install Pester 4.X to temp module path" + Save-Module -Name "Pester" -MaximumVersion 4.99 -Path $modulePath -Force + Write-Verbose -Verbose "Install PSPackageProject to temp module path" + Save-Module -Name PSPackageProject -Path $modulePath -Force + displayName: Install PSPackageProject and dependencies + + - ${{ parameters.powershellExecutable }}: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + # + $sourceName = 'pspackageproject-local-repo' + Register-PackageSource -Name $sourceName -Location "$(System.ArtifactsDirectory)" -ProviderName PowerShellGet -Force -ErrorAction Ignore + Get-PackageSource -Name $sourceName + $config = Get-PSPackageProjectConfiguration + $buildOutputPath = $config.BuildOutputPath + Write-Verbose -Verbose -Message "PSPackage build output path: $buildOutputPath" + $null = New-Item -ItemType Directory -Path $buildOutputPath -Verbose + $moduleName = $config.ModuleName + Write-Verbose -Verbose "Saving package $sourceName to $($config.BuildOutputPath)" + Save-Package -Name $moduleName -Source $sourceName -ProviderName PowerShellGet -Path $config.BuildOutputPath -AllowPrereleaseVersions -Force + displayName: Extract product artifact + + - ${{ parameters.powershellExecutable }}: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + Get-Module + # + Invoke-PSPackageProjectTest -Type Functional + displayName: Execute functional tests + errorActionPreference: continue + + - ${{ parameters.powershellExecutable }}: | + $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' + $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath + $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject + Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" + Import-Module -Name $modPath -Force + Get-Module + # + Invoke-PSPackageProjectTest -Type StaticAnalysis + displayName: Execute static analysis tests + errorActionPreference: continue + condition: succeededOrFailed() + + - ${{ parameters.powershellExecutable }}: | + Unregister-PSRepository -Name 'pspackageproject-local-repo' -ErrorAction Ignore + displayName: Unregister temporary PSRepository + condition: always() diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.yaml b/.github/ISSUE_TEMPLATE/Bug_Report.yaml new file mode 100644 index 0000000..d7cc580 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Bug_Report.yaml @@ -0,0 +1,73 @@ +name: Bug report 🐛 +description: Report errors or unexpected behavior 🤔 +labels: Needs-Triage +body: +- type: markdown + attributes: + value: > + For Windows PowerShell 5.1 issues, suggestions, or feature requests please use the + [Feedback Hub app](https://support.microsoft.com/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332) + + For PowerShellGet v2 issues, please use [PowerShellGetv2 repo](https://github.com/PowerShell/PowerShellGetv2). + + This repository is **ONLY** for PowerShellGet v3 issues. +- type: checkboxes + attributes: + label: Prerequisites + options: + - label: Write a descriptive title. + required: true + - label: Make sure you are able to repro it on the [latest released version](https://www.powershellgallery.com/packages/PowerShellGet) + required: true + - label: Search the existing issues. + required: true +- type: textarea + attributes: + label: Steps to reproduce + description: > + List of steps, sample code, failing test or link to a project that reproduces the behavior. + Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues. + placeholder: > + I am experiencing a problem with X. + I think Y should be happening but Z is actually happening. + validations: + required: true +- type: textarea + attributes: + label: Expected behavior + render: console + placeholder: | + PS> 2 + 2 + 4 + validations: + required: true +- type: textarea + attributes: + label: Actual behavior + render: console + placeholder: | + PS> 2 + 2 + 5 + validations: + required: true +- type: textarea + attributes: + label: Error details + description: Paste verbatim output from `Get-Error` if PowerShell return an error. + render: console + placeholder: PS> Get-Error +- type: textarea + attributes: + label: Environment data + description: Paste verbatim output from `Get-Module PowerShellGet; $PSVersionTable` below. + render: powershell + placeholder: PS> Get-Module PowerShellGet; $PSVersionTable + validations: + required: true +- type: textarea + attributes: + label: Visuals + description: > + Please upload images or animations that can be used to reproduce issues in the area below. + Try the [Steps Recorder](https://support.microsoft.com/en-us/windows/record-steps-to-reproduce-a-problem-46582a9b-620f-2e36-00c9-04e25d784e47) + on Windows or [Screenshot](https://support.apple.com/en-us/HT208721) on macOS. diff --git a/.github/ISSUE_TEMPLATE/Feature_Request.yaml b/.github/ISSUE_TEMPLATE/Feature_Request.yaml new file mode 100644 index 0000000..5079bad --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature_Request.yaml @@ -0,0 +1,20 @@ +name: Feature Request / Idea 🚀 +description: Suggest a new feature or improvement (this does not mean you have to implement it) +labels: [feature_request, Needs-Triage] +body: +- type: textarea + attributes: + label: Summary of the new feature / enhancement + description: > + A clear and concise description of what the problem is that the + new feature would solve. Try formulating it in user story style + (if applicable). + placeholder: "'As a user I want X so that Y...' with X being the being the action and Y being the value of the action." + validations: + required: true +- type: textarea + attributes: + label: Proposed technical implementation details (optional) + placeholder: > + A clear and concise description of what you want to happen. + Consider providing an example PowerShell experience with expected result. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..9fc4f30 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Documentation Issue + url: https://github.com/MicrosoftDocs/PowerShell-Docs + about: Please open issues on documentation for PowerShellGet here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..efbffc5 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,36 @@ + + +# PR Summary + + + +## PR Context + + + +## PR Checklist + +- [ ] [PR has a meaningful title](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) + - Use the present tense and imperative mood when describing your changes +- [ ] [Summarized changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) +- [ ] [Make sure all `.h`, `.cpp`, `.cs`, `.ps1` and `.psm1` files have the correct copyright header](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---submission) +- [ ] This PR is ready to merge and is not [Work in Progress](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#pull-request---work-in-progress). + - If the PR is work in progress, please add the prefix `WIP:` or `[ WIP ]` to the beginning of the title (the `WIP` bot will keep its status check at `Pending` while the prefix is present) and remove the prefix when the PR is ready. +- **[Breaking changes](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#making-breaking-changes)** + - [ ] None + - **OR** + - [ ] [Documentation needed]() + - [ ] Issue filed: +- **User-facing changes** + - [ ] Not Applicable + - **OR** + - [ ] [Documentation needed]() + - [ ] Issue filed: +- **Testing - New and feature** + - [ ] N/A or can only be tested interactively + - **OR** + - [ ] [Make sure you've added a new test if existing tests do not effectively test the code changed](https://github.com/PowerShell/PowerShell/blob/master/.github/CONTRIBUTING.md#before-submitting) +- **Tooling** + - [ ] I have considered the user experience from a tooling perspective and don't believe tooling will be impacted. + - **OR** + - [ ] I have considered the user experience from a tooling perspective and enumerated concerns in the summary. diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..d261f7c --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,62 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + #schedule: + # - cron: '0 7 * * 0' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['csharp'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # â„šī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..557d7d4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +src/code/bin +src/code/obj +srcOld/code/bin +srcOld/code/obj +out diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..596c9b2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,161 @@ +# CHANGELOG + +## 1.0.0.0 + +### Changes +As of the PowerShellGet 3.0.12-beta preview release, PowerShellGetDSC was separated into its own repository. This first version makes this PowerShellGetDSC repository available and complete with testing and building capabilities. + +## 3.0.12-beta + +### Changes +- Support searching for all packages from a repository (i.e 'Find-PSResource -Name '*''). Note, wildcard search is not supported for AzureDevOps feed repositories and will write an error message accordingly). +- Packages found are now unique by Name,Version,Repository. +- Support searching for and returning packages found across multiple repositories when using wildcard with Repository parameter (i.e 'Find-PSResource -Name 'PackageExistingInMultipleRepos' -Repository '*'' will perform an exhaustive search). + - PSResourceInfo objects can be piped into: Install-PSResource, Uninstall-PSResource, Save-PSResource. PSRepositoryInfo objects can be piped into: Unregister-PSResourceRepository +- For more consistent pipeline support, the following cmdlets have pipeline support for the listed parameter(s): + - Find-PSResource (Name param, ValueFromPipeline) + - Get-PSResource (Name param, ValueFromPipeline) + - Install-PSResource (Name param, ValueFromPipeline) + - Publish-PSResource (None) + - Save-PSResource (Name param, ValueFromPipeline) + - Uninstall-PSResource (Name param, ValueFromPipeline) + - Update-PSResource (Name param, ValueFromPipeline) + - Get-PSResourceRepository (Name param, ValueFromPipeline) + - Set-PSResourceRepository (Name param, ValueFromPipeline) + - Register-PSResourceRepository (None) + - Unregister-PSResourceRepository (Name param, ValueFromPipelineByPropertyName) +- Implement '-Tag' parameter set for Find-PSResource (i.e 'Find-PSResource -Tag 'JSON'') +- Implement '-Type' parameter set for Find-PSResource (i.e 'Find-PSResource -Type Module') +- Implement CommandName and DSCResourceName parameter sets for Find-PSResource (i.e Find-PSResource -CommandName "Get-TargetResource"). +- Add consistent pre-release version support for cmdlets, including Uninstall-PSResource and Get-PSResource. For example, running 'Get-PSResource 'MyPackage' -Version '2.0.0-beta'' would only return MyPackage with version "2.0.0" and prerelease "beta", NOT MyPackage with version "2.0.0.0" (i.e a stable version). +- Add progress bar for installation completion for Install-PSResource, Update-PSResource and Save-PSResource. +- Implement '-Quiet' param for Install-PSResource, Save-PSResource and Update-PSResource. This suppresses the progress bar display when passed in. +- Implement '-PassThru' parameter for all appropriate cmdlets. Install-PSResource, Save-PSResource, Update-PSResource and Unregister-PSResourceRepository cmdlets now have '-PassThru' support thus completing this goal. +- Implement '-SkipDependencies' parameter for Install-PSResource, Save-PSResource, and Update-PSResource cmdlets. +- Implement '-AsNupkg' and '-IncludeXML' parameters for Save-PSResource. +- Implement '-DestinationPath' parameter for Publish-PSResource +- Add '-NoClobber' functionality to Install-PSResource. +- Add thorough error handling to Update-PSResource to cover more cases and gracefully write errors when updates can't be performed. +- Add thorough error handling to Install-PSResource to cover more cases and not fail silently when installation could not happen successfully. Also fixes bug where package would install even if it was already installed and '-Reinstall' parameter was not specified. +- Restore package if installation attempt fails when reinstalling a package. +- Fix bug with some Modules installing as Scripts. +- Fix bug with separating '$env:PSModulePath' to now work with path separators across all OS systems including Unix. +- Fix bug to register repositories with local file share paths, ensuring repositories with valid URIs can be registered. +- Revert cmdlet name 'Get-InstalledPSResource' to 'Get-PSResource' +- Remove DSCResources from PowerShellGet. +- Remove unnecessary assemblies. + +## 3.0.11-beta + +### Changes +- Graceful handling of paths that do not exist +- The repository store (PSResourceRepository.xml) is auto-generated if it does not already exist. It also automatically registers the PowerShellGallery with a default priority of 50 and a default trusted value of false. +- Better Linux support, including graceful exits when paths do not exist +- Better pipeline input support all cmdlets +- General wildcard support for all cmdlets +- WhatIf support for all cmdlets +- All cmdlets output concrete return types +- Better help documentation for all cmdlets +- Using an exact prerelease version with Find, Install, or Save no longer requires `-Prerelease` tag +- Support for finding, installing, saving, and updating PowerShell resources from Azure Artifact feeds +- Publish-PSResource now properly dispays 'Tags' in nuspec +- Find-PSResource quickly cancels transactions with 'CTRL + C' +- Register-PSRepository now handles relative paths +- Find-PSResource and Save-PSResource deduplicates dependencies +- Install-PSResource no longer creates version folder with the prerelease tag +- Update-PSResource can now update all resources, and no longer requires name param +- Save-PSResource properly handles saving scripts +- Get-InstalledPSResource uses default PowerShell paths + + +### Notes +In this release, all cmdlets have been reviewed and implementation code refactored as needed. +Cmdlets have most of their functionality, but some parameters are not yet implemented and will be added in future releases. +All tests have been reviewed and rewritten as needed. + + +## 3.0.0-beta10 +Bug Fixes +* Bug fix for -ModuleName (used with -Version) in Find-PSResource returning incorrect resource type +* Make repositories unique by name +* Add tab completion for -Name parameter in Get-PSResource, Set-PSResource, and Unregister-PSResource +* Remove credential argument from Register-PSResourceRepository +* Change returned version type from 'NuGet.Version' to 'System.Version' +* Have Install output verbose message on successful installation (error for unsuccessful installation) +* Ensure that not passing credentials does not throw an error if searching through multiple repositories +* Remove attempt to remove loaded assemblies in psm1 + +## 3.0.0-beta9 +New Features +* Add DSCResources + +Bug Fixes +* Fix bug related to finding dependencies that do not have a specified version in Find-PSResource +* Fix bug related to parsing 'RequiredModules' in .psd1 in Publish-PSResource +* Improve error handling for when repository in Publish-PSResource does not exist +* Fix for unix paths in Get-PSResource, Install-PSResource, and Uninstall-PSResource +* Add debugging statements for Get-PSResource and Install-PSResource +* Fix bug related to paths in Uninstall-PSResource + +## 3.0.0-beta8 +New Features +* Add Type parameter to Install-PSResource +* Add 'sudo' check for admin privileges in Unix in Install-PSResource + +Bug Fixes +* Fix bug with retrieving installed scripts in Get-PSResource +* Fix bug with AllUsers scope in Windows in Install-PSResource +* Fix bug with Uninstall-PSResource sometimes not fully uninstalling +* Change installed file paths to contain original version number instead of normalized version + +## 3.0.0-beta7 +New Features +* Completed functionality for Update-PSResource +* Input-Object parameter for Install-PSResource + +Bug Fixes +* Improved experience when loading module for diffent frameworks +* Bug fix for assembly loading error in Publish-PSResource +* Allow for relative paths when registering psrepository +* Improved error handling for Install-PSResource and Update-PSResource +* Remove prerelease tag from module version directory +* Fix error getting thrown from paths with incorrectly formatted module versions +* Fix module installation paths on Linux and MacOS + +## 3.0.0-beta6 +New Feature +* Implement functionality for Publish-PSResource + +## 3.0.0-beta5 +* Note: 3.0.0-beta5 was skipped due to a packaging error + +## 3.0.0-beta4 +New Feature +* Implement -Repository '*' in Find-PSResource to search through all repositories instead of prioritized repository + +Bug Fix +* Fix poor error handling for when repository is not accessible in Find-PSResource + +## 3.0.0-beta3 +New Features +* -RequiredResource parameter for Install-PSResource +* -RequiredResourceFile parameter for Install-PSResource +* -IncludeXML parameter in Save-PSResource + +Bug Fixes +* Resolved paths in Install-PSRsource and Save-PSResource +* Resolved issues with capitalization (for unix systems) in Install-PSResource and Save-PSResource + +## 3.0.0-beta2 +New Features +* Progress bar and -Quiet parameter for Install-PSResource +* -TrustRepository parameter for Install-PSResource +* -NoClobber parameter for Install-PSResource +* -AcceptLicense for Install-PSResource +* -Force parameter for Install-PSResource +* -Reinstall parameter for Install-PSResource +* Improved error handling + +## 3.0.0-beta1 +BREAKING CHANGE +* Preview version of PowerShellGet. Many features are not fully implemented yet. Please see https://devblogs.microsoft.com/powershell/powershellget-3-0-preview1 for more details. \ No newline at end of file diff --git a/Examples/Resources/PSModule/5-PSModule_InstallModuleWithinVersionRangeConfig.ps1 b/Examples/Resources/PSModule/5-PSModule_InstallModuleWithinVersionRangeConfig.ps1 index 9c69951..928c521 100644 --- a/Examples/Resources/PSModule/5-PSModule_InstallModuleWithinVersionRangeConfig.ps1 +++ b/Examples/Resources/PSModule/5-PSModule_InstallModuleWithinVersionRangeConfig.ps1 @@ -19,10 +19,10 @@ <# .SYNOPSIS - Configuration that installs a module withing a specific version range. + Configuration that installs a module within a specific version range. .DESCRIPTION - Configuration that installs a module withing a specific version range. + Configuration that installs a module within a specific version range. .PARAMETER NodeName The names of one or more nodes to compile a configuration for. diff --git a/Notice.txt b/Notice.txt new file mode 100644 index 0000000..9fec896 --- /dev/null +++ b/Notice.txt @@ -0,0 +1,2025 @@ +NOTICES AND INFORMATION +Do Not Translate or Localize + +This software incorporates material from third parties. +Microsoft makes certain open source code available at https://3rdpartysource.microsoft.com, +or you may send a check or money order for US $5.00, including the product name, +the open source component name, platform, and version number, to: + +Source Code Compliance Team +Microsoft Corporation +One Microsoft Way +Redmond, WA 98052 +USA + +Notwithstanding any other terms, you may reverse engineer this software to the extent +required to debug changes to any libraries licensed under the GNU Lesser General Public License. + +--------------------------------------------------------- + +NuGet.Commands 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.Common 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.Configuration 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.Credentials 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.DependencyResolver.Core 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.Frameworks 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.LibraryModel 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.Packaging 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.ProjectModel 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.Protocol 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +NuGet.Versioning 5.8.0 - Apache-2.0 + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. + +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + + + + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + + + + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + + + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + + + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + + + + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + + + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + + + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + + + + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + + (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); + +you may not use this file except in compliance with the License. + +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software + +distributed under the License is distributed on an "AS IS" BASIS, + +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +See the License for the specific language governing permissions and + +limitations under the License. + +--------------------------------------------------------- + +--------------------------------------------------------- + +morelinq 3.3.2 - Apache-2.0 AND MIT + + +(c) 2008 VeriSign, Inc. +(c) 2008 Jonathan Skeet. +Portions (c) 2017 Jonas Nyrup +Portions (c) 2015 Felipe Sateler +Copyright (c) Microsoft Corporation +Portions (c) 2010 Johannes Rudolph, Leopold Bushkin. +Portions (c) 2009 Atif Aziz, Chris Ammerman, Konrad Rudolph. +Portions (c) 2016 Andreas Gullberg Larsen, Leandro F. Vieira + + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + +============================================================================== +The following notice applies to a small portion of the code: + +The MIT License (MIT) + +Copyright (c) Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +LinqKit.Core 1.1.17 - MIT + + +(c) 2008 VeriSign, Inc. + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Bcl.AsyncInterfaces 1.0.0 - MIT + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. +Copyright (c) .NET Foundation. +Copyright (c) 2011, Google Inc. +(c) 1997-2005 Sean Eron Anderson. +Copyright (c) 2007 James Newton-King +Copyright (c) 1991-2017 Unicode, Inc. +Copyright (c) 2013-2017, Alfred Klomp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2005-2007, Nick Galbreath +Portions (c) International Organization +Copyright (c) 2015 The Chromium Authors. +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2016-2017, Matthieu Darbois +Copyright (c) .NET Foundation Contributors +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Extensions.DependencyInjection 5.0.0-preview.7.20364.11 - MIT + + + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Extensions.DependencyInjection.Abstractions 5.0.0-preview.7.20364.11 - MIT + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. +Copyright (c) Andrew Arnott +Copyright 2018 Daniel Lemire +Copyright 2012 the V8 project +Copyright (c) .NET Foundation. +Copyright (c) 2011, Google Inc. +Copyright (c) 1998 Microsoft. To +(c) 1997-2005 Sean Eron Anderson. +Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) Microsoft Corporation +Copyright (c) 2007 James Newton-King +Copyright (c) 2012-2014, Yann Collet +Copyright (c) 2013-2017, Alfred Klomp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2005-2007, Nick Galbreath +Copyright (c) 2018 Alexander Chermyanin +Portions (c) International Organization +Copyright (c) 2015 The Chromium Authors. +Copyright (c) The Internet Society 1997. +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2013-2017, Milosz Krajewski +Copyright (c) 2016-2017, Matthieu Darbois +Copyright (c) .NET Foundation Contributors +Copyright (c) The Internet Society (2003). +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. +Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com +Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. +Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P. +Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California. +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Extensions.Options 5.0.0-preview.7.20364.11 - MIT + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. +Copyright (c) Andrew Arnott +Copyright 2018 Daniel Lemire +Copyright 2012 the V8 project +Copyright (c) .NET Foundation. +Copyright (c) 2011, Google Inc. +Copyright (c) 1998 Microsoft. To +(c) 1997-2005 Sean Eron Anderson. +Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) Microsoft Corporation +Copyright (c) 2007 James Newton-King +Copyright (c) 2012-2014, Yann Collet +Copyright (c) 2013-2017, Alfred Klomp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2005-2007, Nick Galbreath +Copyright (c) 2018 Alexander Chermyanin +Portions (c) International Organization +Copyright (c) 2015 The Chromium Authors. +Copyright (c) The Internet Society 1997. +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2013-2017, Milosz Krajewski +Copyright (c) 2016-2017, Matthieu Darbois +Copyright (c) .NET Foundation Contributors +Copyright (c) The Internet Society (2003). +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. +Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com +Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. +Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P. +Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California. +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Microsoft.Extensions.Primitives 5.0.0-preview.7.20364.11 - MIT + + + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +Newtonsoft.Json 9.0.1 - MIT + + +(c) 2008 VeriSign, Inc. +Copyright James Newton-King 2008 + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +PowerShellStandard.Library 7.0.0-preview.1 - MIT + + + +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--------------------------------------------------------- + +--------------------------------------------------------- + +System.Data.DataSetExtensions 4.6.0-preview3.19128.7 - MIT + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. +Copyright (c) 2011, Google Inc. +(c) 1997-2005 Sean Eron Anderson. +Copyright (c) 1991-2017 Unicode, Inc. +Portions (c) International Organization +Copyright (c) 2015 The Chromium Authors. +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) .NET Foundation Contributors +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +System.Memory 4.5.3 - MIT + + +(c) 2008 VeriSign, Inc. +Copyright (c) 2011, Google Inc. +(c) 1997-2005 Sean Eron Anderson. +Copyright (c) 1991-2017 Unicode, Inc. +Portions (c) International Organization +Copyright (c) 2015 The Chromium Authors. +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) .NET Foundation Contributors +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +System.Runtime.CompilerServices.Unsafe 5.0.0-preview.7.20364.11 - MIT + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. +Copyright (c) Andrew Arnott +Copyright 2018 Daniel Lemire +Copyright 2012 the V8 project +Copyright (c) .NET Foundation. +Copyright (c) 2011, Google Inc. +Copyright (c) 1998 Microsoft. To +(c) 1997-2005 Sean Eron Anderson. +Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) Microsoft Corporation +Copyright (c) 2007 James Newton-King +Copyright (c) 2012-2014, Yann Collet +Copyright (c) 2013-2017, Alfred Klomp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2005-2007, Nick Galbreath +Copyright (c) 2018 Alexander Chermyanin +Portions (c) International Organization +Copyright (c) 2015 The Chromium Authors. +Copyright (c) The Internet Society 1997. +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2013-2017, Milosz Krajewski +Copyright (c) 2016-2017, Matthieu Darbois +Copyright (c) .NET Foundation Contributors +Copyright (c) The Internet Society (2003). +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. +Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com +Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. +Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P. +Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California. +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +System.Security.Cryptography.Pkcs 5.0.0-preview.3.20214.6 - MIT + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. +Copyright (c) Andrew Arnott +Copyright 2018 Daniel Lemire +Copyright 2012 the V8 project +Copyright (c) .NET Foundation. +Copyright (c) 2011, Google Inc. +Copyright (c) 1998 Microsoft. To +(c) 1997-2005 Sean Eron Anderson. +Copyright (c) 2017 Yoshifumi Kawai +Copyright (c) Microsoft Corporation +Copyright (c) 2007 James Newton-King +Copyright (c) 2012-2014, Yann Collet +Copyright (c) 2013-2017, Alfred Klomp +Copyright (c) 2015-2017, Wojciech Mula +Copyright (c) 2005-2007, Nick Galbreath +Portions (c) International Organization +Copyright (c) 2015 The Chromium Authors. +Copyright (c) The Internet Society 1997. +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) 2013-2017, Milosz Krajewski +Copyright (c) 2016-2017, Matthieu Darbois +Copyright (c) .NET Foundation Contributors +Copyright (c) The Internet Society (2003). +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. +Copyright (c) 2014 Ryan Juckett http://www.ryanjuckett.com +Copyright (c) 1990- 1993, 1996 Open Software Foundation, Inc. +Copyright (c) 2003-2005 Hewlett-Packard Development Company, L.P. +Copyright (c) 2015 THL A29 Limited, a Tencent company, and Milo Yip. +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The Regents of the University of California. +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. +Copyright (c) 1989 by Hewlett-Packard Company, Palo Alto, Ca. & Digital Equipment Corporation, Maynard, Mass. To + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + +--------------------------------------------------------- + +System.Security.Cryptography.ProtectedData 4.4.0 - MIT + + +(c) 2008 VeriSign, Inc. +(c) Microsoft Corporation. +(c) 1997-2005 Sean Eron Anderson. +Copyright (c) 1991-2017 Unicode, Inc. +Portions (c) International Organization +Copyright (c) 2004-2006 Intel Corporation +Copyright (c) .NET Foundation Contributors +Copyright (c) .NET Foundation and Contributors +Copyright (c) 2011 Novell, Inc (http://www.novell.com) +Copyright (c) 1995-2017 Jean-loup Gailly and Mark Adler +Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +Copyright (c) YEAR W3C(r) (MIT, ERCIM, Keio, Beihang). Disclaimers THIS WORK IS PROVIDED AS + +The MIT License (MIT) + +Copyright (c) .NET Foundation and Contributors + +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +--------------------------------------------------------- + diff --git a/bootstrap.ps1 b/bootstrap.ps1 new file mode 100644 index 0000000..ab2e169 --- /dev/null +++ b/bootstrap.ps1 @@ -0,0 +1,127 @@ +## bootstrap.ps1 +# Use the .NET Core APIs to determine the current platform; if a runtime +# exception is thrown, we are on FullCLR, not .NET Core. +try { + $Runtime = [System.Runtime.InteropServices.RuntimeInformation] + $OSPlatform = [System.Runtime.InteropServices.OSPlatform] + + $IsCoreCLR = ($PSVersionTable.ContainsKey('PSEdition')) -and ($PSVersionTable.PSEdition -eq 'Core') + $IsLinux = $Runtime::IsOSPlatform($OSPlatform::Linux) + $IsMacOS = $Runtime::IsOSPlatform($OSPlatform::OSX) + $IsWindows = $Runtime::IsOSPlatform($OSPlatform::Windows) +} +catch { + # If these are already set, then they're read-only and we're done + try { + $IsCoreCLR = $false + $IsLinux = $false + $IsMacOS = $false + $IsWindows = $true + } + catch { } +} + +if ($IsLinux) { + $LinuxInfo = Get-Content /etc/os-release | ConvertFrom-StringData + + $IsUbuntu = $LinuxInfo.ID -match 'ubuntu' + $IsUbuntu14 = $IsUbuntu -and $LinuxInfo.VERSION_ID -match '14.04' + $IsUbuntu16 = $IsUbuntu -and $LinuxInfo.VERSION_ID -match '16.04' + $IsCentOS = $LinuxInfo.ID -match 'centos' -and $LinuxInfo.VERSION_ID -match '7' +} + +function Start-DotnetBootstrap { + [CmdletBinding( + SupportsShouldProcess = $true, + ConfirmImpact = "High")] + param( + [string]$Channel = "preview", + #[string]$Version = "latest", + # we currently pin dotnet-cli version, because tool + # is currently migrating to msbuild toolchain + # and requires constant updates to our build process. + [string]$Version = "2.1.503" + ) + + # Install ours and .NET's dependencies + $Deps = @() + if ($IsUbuntu) { + # Build tools + $Deps += "curl", "g++", "cmake", "make" + + # .NET Core required runtime libraries + $Deps += "libunwind8" + if ($IsUbuntu14) { $Deps += "libicu52" } + elseif ($IsUbuntu16) { $Deps += "libicu55" } + + # Install dependencies + sudo apt-get install -y -qq $Deps + } + elseif ($IsCentOS) { + # Build tools + $Deps += "which", "curl", "gcc-c++", "cmake", "make" + + # .NET Core required runtime libraries + $Deps += "libicu", "libunwind" + + # Install dependencies + sudo yum install -y -q $Deps + } + elseif ($IsMacOS) { + + # Build tools + $Deps += "curl", "cmake" + + # .NET Core required runtime libraries + $Deps += "openssl" + + # Install dependencies + brew install $Deps + } + + $obtainUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain" + + # Install for Linux and OS X + if ($IsLinux -or $IsMacOS) { + # Uninstall all previous dotnet packages + $uninstallScript = if ($IsUbuntu) { + "dotnet-uninstall-debian-packages.sh" + } + elseif ($IsMacOS) { + "dotnet-uninstall-pkgs.sh" + } + + if ($uninstallScript) { + curl -s $obtainUrl/uninstall/$uninstallScript -o $uninstallScript + chmod +x $uninstallScript + sudo ./$uninstallScript + } + else { + Write-Warning "This script only removes prior versions of dotnet for Ubuntu 14.04 and OS X" + } + + # Install new dotnet 1.0.0 preview packages + $installScript = "dotnet-install.sh" + curl -s $obtainUrl/$installScript -o $installScript + chmod +x $installScript + bash ./$installScript -c $Channel -v $Version + + # .NET Core's crypto library needs brew's OpenSSL libraries added to its rpath + if ($IsMacOS) { + # This is the library shipped with .NET Core + # This is allowed to fail as the user may have installed other versions of dotnet + Write-Warning ".NET Core links the incorrect OpenSSL, correcting .NET CLI libraries..." + find $env:HOME/.dotnet -name System.Security.Cryptography.Native.dylib | xargs sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib + } + } + + # Install for Windows + if ($IsWindows) { + Remove-Item -ErrorAction SilentlyContinue -Recurse -Force ~\AppData\Local\Microsoft\dotnet + $installScript = "dotnet-install.ps1" + Invoke-WebRequest -Uri $obtainUrl/$installScript -OutFile $installScript + & ./$installScript -c $Channel -Version $Version + } +} + +Start-DotnetBootstrap diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000..26ea93c --- /dev/null +++ b/build.ps1 @@ -0,0 +1,117 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +# Do NOT edit this file. Edit dobuild.ps1 +[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "")] +param ( + [Parameter(ParameterSetName="build")] + [switch] + $Clean, + + [Parameter(ParameterSetName="build")] + [switch] + $Build, + + [Parameter(ParameterSetName="publish")] + [switch] + $Publish, + + [Parameter(ParameterSetName="publish")] + [switch] + $Signed, + + [Parameter(ParameterSetName="build")] + [switch] + $Test, + + [Parameter(ParameterSetName="build")] + [string[]] + [ValidateSet("Functional","StaticAnalysis")] + $TestType = @("Functional"), + + [Parameter(ParameterSetName="help")] + [switch] + $UpdateHelp, + + [ValidateSet("Debug", "Release")] + [string] $BuildConfiguration = "Debug", + + [ValidateSet("netstandard2.0")] + [string] $BuildFramework = "netstandard2.0" +) + +if ( ! ( Get-Module -ErrorAction SilentlyContinue PSPackageProject) ) { + Install-Module -Name PSPackageProject -MinimumVersion 0.1.18 -Force +} + +$config = Get-PSPackageProjectConfiguration -ConfigPath $PSScriptRoot + +$script:ModuleName = $config.ModuleName +$script:FormatFileName = $config.FormatFileName +$script:SrcPath = $config.SourcePath +$script:OutDirectory = $config.BuildOutputPath +$script:SignedDirectory = $config.SignedOutputPath +$script:TestPath = $config.TestPath + +$script:ModuleRoot = $PSScriptRoot +$script:Culture = $config.Culture +$script:HelpPath = $config.HelpPath + +$script:BuildConfiguration = $BuildConfiguration +$script:BuildFramework = $BuildFramework + +if ($env:TF_BUILD) { + $vstsCommandString = "vso[task.setvariable variable=BUILD_OUTPUT_PATH]$OutDirectory" + Write-Host ("sending " + $vstsCommandString) + Write-Host "##$vstsCommandString" + + $vstsCommandString = "vso[task.setvariable variable=SIGNED_OUTPUT_PATH]$SignedDirectory" + Write-Host ("sending " + $vstsCommandString) + Write-Host "##$vstsCommandString" +} + +. $PSScriptRoot/doBuild.ps1 + +if ($Clean) { + if (Test-Path $OutDirectory) { + Remove-Item -Path $OutDirectory -Force -Recurse -ErrorAction Stop -Verbose + } + + if (Test-Path "${SrcPath}/code/bin") + { + Remove-Item -Path "${SrcPath}/code/bin" -Recurse -Force -ErrorAction Stop -Verbose + } + + if (Test-Path "${SrcPath}/code/obj") + { + Remove-Item -Path "${SrcPath}/code/obj" -Recurse -Force -ErrorAction Stop -Verbose + } +} + +if (-not (Test-Path $OutDirectory)) +{ + $script:OutModule = New-Item -ItemType Directory -Path (Join-Path $OutDirectory $ModuleName) +} +else +{ + $script:OutModule = Join-Path $OutDirectory $ModuleName +} + +if ($Build.IsPresent) +{ + $sb = (Get-Item Function:DoBuild).ScriptBlock + Invoke-PSPackageProjectBuild -BuildScript $sb -SkipPublish +} + +if ($Publish.IsPresent) +{ + Invoke-PSPackageProjectPublish -Signed:$Signed.IsPresent -AllowPreReleaseDependencies +} + +if ( $Test.IsPresent ) { + Invoke-PSPackageProjectTest -Type $TestType +} + +if ($UpdateHelp.IsPresent) { + Add-PSPackageProjectCmdletHelp -ProjectRoot $ModuleRoot -ModuleName $ModuleName -Culture $Culture +} diff --git a/doBuild.ps1 b/doBuild.ps1 new file mode 100644 index 0000000..5e5ff78 --- /dev/null +++ b/doBuild.ps1 @@ -0,0 +1,123 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + +<# +.DESCRIPTION +Implement build and packaging of the package and place the output $OutDirectory/$ModuleName +#> +function DoBuild +{ + Write-Verbose -Verbose -Message "Starting DoBuild for $ModuleName with configuration: $BuildConfiguration, framework: $BuildFramework" + + # Module build out path + $BuildOutPath = "${OutDirectory}/${ModuleName}" + Write-Verbose -Verbose -Message "Module output file path: '$BuildOutPath'" + + # Module build source path + $BuildSrcPath = "bin/${BuildConfiguration}/${BuildFramework}/publish" + Write-Verbose -Verbose -Message "Module build source path: '$BuildSrcPath'" + + # Copy module script files + Write-Verbose -Verbose "Copy-Item ${SrcPath}/${ModuleName}.psd1 to $BuildOutPath" + Copy-Item -Path "${SrcPath}/${ModuleName}.psd1" -Dest "$BuildOutPath" -Force + + # #Copy module format ps1xml file + # Write-Verbose -Verbose -Message "Copy-Item ${SrcPath}/${FormatFileName}.ps1xml to $BuildOutPath" + # Copy-Item -Path "${SrcPath}/${FormatFileName}.ps1xml" -Dest "$BuildOutPath" -Force + + # Create BuildFramework directory for binary location + $BuildOutputBin = Join-Path -Path $BuildOutPath -ChildPath $BuildFramework + if (! (Test-Path -Path $BuildOutputBin)) { + Write-Verbose -Verbose "Creating output path for binaries: $BuildOutputBin" + $null = New-Item -ItemType Directory -Path $BuildOutputBin + } + + # Copy help + Write-Verbose -Verbose -Message "Copying help files to '$BuildOutPath'" + Copy-Item -Path "${HelpPath}/${Culture}" -Dest "$BuildOutPath" -Recurse -Force + + # Copy license + Write-Verbose -Verbose -Message "Copying LICENSE file to '$BuildOutPath'" + Copy-Item -Path "./LICENSE" -Dest "$BuildOutPath" + + # Copy notice + Write-Verbose -Verbose -Message "Copying ThirdPartyNotices.txt to '$BuildOutPath'" + Copy-Item -Path "./Notice.txt" -Dest "$BuildOutPath" + + # Build and place binaries + if ( Test-Path "${SrcPath}/code" ) { + Write-Verbose -Verbose -Message "Building assembly and copying to '$BuildOutPath'" + # Build code and place it in the staging location + Push-Location "${SrcPath}/code" + try { + # Build source + Write-Verbose -Verbose -Message "Building with configuration: $BuildConfiguration, framework: $BuildFramework" + Write-Verbose -Verbose -Message "Build location: PSScriptRoot: $PSScriptRoot, PWD: $pwd" + dotnet publish --configuration $BuildConfiguration --framework $BuildFramework --output $BuildSrcPath -warnaserror + if ($LASTEXITCODE -ne 0) { + throw "Build failed with exit code: $LASTEXITCODE" + } + + # Place build results + $assemblyNames = @( + 'PowerShellGet' + 'MoreLinq' + 'NuGet.Commands' + 'NuGet.Common' + 'NuGet.Configuration' + 'NuGet.Frameworks' + 'NuGet.Packaging' + 'NuGet.ProjectModel' + 'NuGet.Protocol' + 'NuGet.Repositories' + 'NuGet.Versioning' + 'Newtonsoft.Json' + ) + + $buildSuccess = $true + foreach ($fileName in $assemblyNames) + { + # Copy bin file + $filePath = Join-Path -Path $BuildSrcPath -ChildPath "${fileName}.dll" + if (! (Test-Path -Path $filePath)) + { + Write-Error "Expected file $filePath is missing from build output." + $BuildSuccess = $false + continue + } + + Copy-Item -Path $filePath -Dest $BuildOutputBin -Verbose -Force + + # Copy pdb file if available + $filePathPdb = Join-Path -Path $BuildSrcPath -ChildPath "${fileName}.pdb" + if (Test-Path -Path $filePathPdb) + { + Copy-Item -Path $filePathPdb -Dest $BuildOutputBin -Verbose -Force + } + } + + if (! $buildSuccess) + { + throw "Build failed to create expected binaries." + } + + if (! (Test-Path -Path "$BuildSrcPath/${ModuleName}.dll")) + { + throw "Expected binary was not created: $BuildSrcPath/${ModuleName}.dll" + } + } + catch { + # Write-Error "dotnet build failed with error: $_" + Write-Verbose -Verbose -Message "dotnet build failed with error: $_" + } + finally { + Pop-Location + } + } + else { + Write-Verbose -Verbose -Message "No code to build in '${SrcPath}/code'" + } + + ## Add build and packaging here + Write-Verbose -Verbose -Message "Ending DoBuild" +} diff --git a/help/Find-PSResource.md b/help/Find-PSResource.md new file mode 100644 index 0000000..e2a9d33 --- /dev/null +++ b/help/Find-PSResource.md @@ -0,0 +1,320 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Find-PSResource + +## SYNOPSIS +Searches for packages from a repository (local or remote), based on `-Name` and other package properties. + +## SYNTAX + +### ResourceNameParameterSet (Default) +``` PowerShell +[[-Name] ] [-Type ] [-Version ] [-Prerelease] [-Tag ] [-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] +``` + +### CommandNameParameterSet +``` PowerShell +[[-CommandName] ] [-ModuleName ] [-Version ] [-Prerelease] [-Tag ] +[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] +``` + +### DscResourceNameParameterSet +``` PowerShell +[[-DscResourceName] ] [-ModuleName ] [-Version ] [-Prerelease] [-Tag ] +[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] +``` + +### TagParameterSet +``` PowerShell +[[-Name ][-Tag ] [-Prerelease] +[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] +``` + +### TypeParameterSet +``` PowerShell +[[Name ] [-Prerelease] [-Type ] +[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The `Find-PSResource` cmdlet searches for a package from a repository (local or remote) based on `-Name` or other package properties. + +## EXAMPLES +These examples assume that the PSGallery repository is registered and contains the packages we are searching for. +### Example 1 +```powershell +PS C:\> Find-PSResource -Name "Microsoft.PowerShell.SecretManagement" -Repository PSGallery + Name Version Prerelease Description + ---- ------- ---------- ----------- + Microsoft.PowerShell.SecretManagement 1.0.0.0 This module ... +``` + +This examples searches for the package with `-Name` "Microsoft.PowerShell.SecretManagement". It returns the highest non-prerelease version for the package found by searching through the `-Repository` "PSGallery", which at the time of writing this example is version "1.0.0.0". + +### Example 2 +```powershell +PS C:\> Find-PSResource -Name "Microsoft.PowerShell.SecretManagement" -Repository PSGallery -Prerelease + Name Version Prerelease Description + ---- ------- ---------- ----------- + Microsoft.PowerShell.SecretManagement 1.1.0.0 preview2 This module ... +``` + +This examples searches for the package with `-Name` "Microsoft.PowerShell.SecretManagement". It returns the highest version (including considering prerelease versions) for the package found by searching through the specified `-Repository` "PSGallery", which at the time of writing this example is version "1.1.0-preview2". + +### Example 3 +```powershell +PS C:\> Find-PSResource -Name "Microsoft.PowerShell.SecretManagement" -Version "(0.9.0.0, 1.0.0.0]" -Repository PSGallery -Prerelease + Name Version Prerelease Description + ---- ------- ---------- ----------- + Microsoft.PowerShell.SecretManagement 0.9.1.0 This module ... + Microsoft.PowerShell.SecretManagement 1.0.0.0 This module ... +``` + +This examples searches for the package with `-Name` "Microsoft.PowerShell.SecretManagement". It returns all versions which satisfy the specified `-Version` range by looking through the specified `-Repository` "PSGallery". At the time of writing this example those satisfying versions are: "0.9.1.0" and "1.0.0.0". + +### Example 4 +```powershell +PS C:\> Find-PSResource -CommandName "Get-TargetResource" -Repository PSGallery + Name Version Prerelease ModuleName Repository + ---- ------- ---------- ---------- ---------- + Get-TargetResource 3.1.0.0 xPowerShellExecutionPolicy PSGallery + Get-TargetResource 1.0.0.4 WindowsDefender PSGallery + Get-TargetResource 1.2.0.0 SystemLocaleDsc PSGallery + Get-TargetResource 1.0.0.0 xInternetExplorerHomePage PSGallery + Get-TargetResource 4.0.1055.0 OctopusDSC PSGallery + Get-TargetResource 1.2.0.0 cRegFile PSGallery + Get-TargetResource 1.1.0.0 cWindowsErrorReporting PSGallery + Get-TargetResource 1.0.0.0 cVNIC PSGallery + Get-TargetResource 1.1.17.0 supVsts PSGallery + +``` + +This examples searches for all module resources with `-CommandName` "Get-TargetResource" from the `-Repository` PSGallery. It returns all the module resources which include a command named "Get-TargetResource" and also lists the following information for each module resource: version, name (displayed under ModuleName) and repository. To access the rest of the properties of the parent module resource, you can access the `$_.ParentResource` of the PSIncludedResourceInfo object returned from the CommandName parameter set. + +### Example 5 +```powershell +PS C:\> Find-PSResource -CommandName "Get-TargetResource" -ModuleName "SystemLocaleDsc" -Repository PSGallery + Name Version Prerelease ModuleName Repository + ---- ------- ---------- ---------- ---------- + Get-TargetResource 1.2.0.0 SystemLocaleDsc PSGallery +``` + +This examples searches for a module resource with a command named "Get-TargetResource" (via the `-CommandName` parameter), specifically from the module resource "SystemLocaleDsc" (via the `-ModuleName` parameter) from the `-Repository` PSGallery. The "SystemLocaleDsc" resource does indeed include a command named Get-TargetResource so this resource will be returned. The returned object lists the name of the command (displayed under Name) and the following information for the parent module resource: version, name (displayed under ModuleName) and repository. To access the rest of the properties of the parent module resource, you can access the `$_.ParentResource` of the PSIncludedResourceInfo object returned from the CommandName parameter set. + +### Example 6 +```powershell +PS C:\> Find-PSResource -DscResourceName "SystemLocale" -Repository PSGallery + Name Version Prerelease ModuleName Repository + ---- ------- ---------- ---------- ---------- + Get-TargetResource 8.5.0.0 ComputerManagementDsc PSGallery + Get-TargetResource 1.2.0.0 SystemLocaleDsc PSGallery + +``` + +This examples searches for all module resources with `-DscResourceName` "SystemLocale" from the `-Repository` PSGallery. It returns all the module resources which include a DSC resource named "SystemLocale" and also lists the following information for each module resource: version, name (displayed under ModuleName) and repository. To access the rest of the properties of the parent module resource, you can access the `$_.ParentResource` of the PSIncludedResourceInfo object returned from the DSCResourceName parameter set. + +## PARAMETERS + +### -Credential +Optional credentials to be used when accessing a repository. + +```yaml +Type: System.Management.Automation.PSCredential +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IncludeDependencies +When specified, search will return all matched resources along with any resources the matched resources depends on. +Dependencies are deduplicated. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ModuleName +Specifies a module resource package name type to search for. +Wildcards are supported. +Not yet implemented. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of a resource or resources to find. +Accepts wild card character '*'. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: True +``` + +### -Prerelease +When specified, includes prerelease versions in search results returned. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Repository +Specifies one or more repository names to search, which can include wildcard. +If not specified, search will include all currently registered repositories, in order of highest priority, until a repository is found that contains the package. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: True +``` + +### -Tag +Filters search results for resources that include one or more of the specified tags. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Type +Specifies one or more resource types to find. +Resource types supported are: Module, Script, Command, DscResource. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[] +Parameter Sets: (All) +Aliases: +Accepted values: Module, Script, DscResource, Command + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Version +Specifies the version of the resource to be returned. The value can be an exact version or a version +range using the NuGet versioning syntax. + +For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) + +PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range +documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher +(minimum inclusive range). Instead, the values is considered as the required version and yields +version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as +the version range. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String[] + +## OUTPUTS + +### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo + +## NOTES + +## RELATED LINKS + +[]() diff --git a/help/Get-PSResource.md b/help/Get-PSResource.md new file mode 100644 index 0000000..c7ccdb5 --- /dev/null +++ b/help/Get-PSResource.md @@ -0,0 +1,153 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Get-PSResource + +## SYNOPSIS +Returns resources (modules and scripts) installed on the machine via PowerShellGet. + +## SYNTAX + +``` +Get-PSResource [[-Name] ] [-Version ] [-Path ] [] +``` + +## DESCRIPTION +The Get-PSResource cmdlet combines the Get-InstalledModule, Get-InstalledScript cmdlets from V2. It performs a search within module or script installation paths based on the -Name parameter argument. It returns PSResourceInfo objects which describes each resource item found. Other parameters allow the returned results to be filtered by version and path. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-PSResource Az +``` + +This will return versions of the Az module installed via PowerShellGet. + +### Example 2 +```powershell +PS C:\> Get-PSResource Az -version "1.0.0" +``` + +This will return version 1.0.0 of the Az module. + +### Example 3 +```powershell +PS C:\> Get-PSResource Az -version "(1.0.0, 3.0.0)" +``` + +This will return all versions of the Az module within the specified range. + +### Example 4 +```powershell +PS C:\> Get-PSResource Az -Path . +``` + +This will return all versions of the Az module that have been installed in the current directory. + +### Example 5 +```powershell +PS C:\> Get-PSResource +``` + +This will return all versions and scripts installed on the machine. + +## PARAMETERS + +### -Name +Name of a resource or resources to find. Accepts wild card characters or a null value. + +```yaml +Type: System.String[] +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: True +``` + +### -Path +Specifies the path to search in. + +```yaml +Type: System.String +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Version +Specifies the version of the resource to be returned. The value can be an exact version or a version +range using the NuGet versioning syntax. + +For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) + +PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range +documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher +(minimum inclusive range). Instead, the values is considered as the required version and yields +version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as +the version range. + +```yaml +Type: System.String +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## OUTPUTS + +### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo +``` +PSResourceInfo : { + AdditionalMetadata + Author + CompanyName + Copyright + Dependencies + Description + IconUri + Includes + InstalledDate + InstalledLocation + IsPrerelease + LicenseUri + Name + PackageManagementProvider + PowerShellGetFormatVersion + PrereleaseLabel + ProjectUri + PublishedDate + ReleaseNotes + Repository + RepositorySourceLocation + Tags + Type + UpdatedDate + Version +} +``` + +## NOTES + +## RELATED LINKS diff --git a/help/Get-PSResourceRepository.md b/help/Get-PSResourceRepository.md new file mode 100644 index 0000000..35c32e0 --- /dev/null +++ b/help/Get-PSResourceRepository.md @@ -0,0 +1,102 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Get-PSResourceRepository + +## SYNOPSIS +Finds and returns registered repository information. + +## SYNTAX + +``` +Get-PSResourceRepository [[-Name] ] [] +``` + +## DESCRIPTION +The Get-PSResourceRepository cmdlet searches for the PowerShell resource repositories that are registered on the machine. By default it will return all registered repositories, or if the `-Name` parameter argument is specified then it will return the repository which matches that name. It returns PSRepositoryInfo objects which contain information for each repository item found. + +## EXAMPLES + +### Example 1 +``` +PS C:\> Get-PSResourceRepository -Name "PSGallery" + Name Url Trusted Priority + ---- --- ------- -------- + PSGallery https://www.powershellgallery.com/api/v2 False 50 +``` + +This example runs the command with the 'Name' parameter being set to "PSGallery". This repository is registered on this machine so the command returns information on this repository. + +### Example 2 +``` +PS C:\> Get-PSResourceRepository -Name "*Gallery" + Name Url Trusted Priority + ---- --- ------- -------- + PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40 + PSGallery https://www.powershellgallery.com/api/v2 False 50 + +``` + +This example runs the command with the 'Name' parameter being set to "*Gallery" which includes a wildcard. The following repositories are registered on this machine and match the name pattern, so the command returns information on these repositories. + +### Example 3 +``` +PS C:\> Get-PSResourceRepository -Name "PSGallery","PoshTestGallery" + Name Url Trusted Priority + ---- --- ------- -------- + PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40 + PSGallery https://www.powershellgallery.com/api/v2 False 50 + +``` + +This example runs the command with the 'Name' parameter being set to an array of Strings. Both of the specified repositories are registered on this machine and match the name pattern, so the command returns information on these repositories. + +### Example 4 +``` +PS C:\> Get-PSResourceRepository -Name "*" + Name Url Trusted Priority + ---- --- ------- -------- + PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40 + PSGallery https://www.powershellgallery.com/api/v2 False 50 + psgettestlocal file:///c:/code/testdir True 50 + +``` + +This example runs the command with the 'Name' parameter being set to a single wildcard character. So all the repositories registered on this machine are returned. + +## PARAMETERS + +### -Name +This parameter takes a String argument, including wildcard characters, or an array of such String arguments. It is used to search for repository names from the repository store which match the provided name pattern. Tab completion is provided on this argument and will display registered repository names. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: True +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String[] + +## OUTPUTS + +### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo + +## NOTES +If no value for Name is provided, Get-PSResourceRepository will return information for all registered repositories. + +## RELATED LINKS diff --git a/help/Install-PSResource.md b/help/Install-PSResource.md new file mode 100644 index 0000000..8272e9f --- /dev/null +++ b/help/Install-PSResource.md @@ -0,0 +1,325 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Install-PSResource + +## SYNOPSIS +Installs resources (modules and scripts) from a registered repository onto the machine. + +## SYNTAX + +### NameParameterSet +``` +Install-PSResource [-Name] [-Version ] [-Prerelease] + [-Repository ] [-Credential ] [-Scope ] [-TrustRepository] + [-Reinstall] [-Quiet] [-AcceptLicense] [-NoClobber] [-SkipDependencyCheck] [-PassThru] [-WhatIf] [-Confirm] [] +``` + +### InputObjectParameterSet +``` +Install-PSResource [-InputObject ] [-Credential ] [-Scope ] [-TrustRepository] + [-Reinstall] [-Quiet] [-AcceptLicense] [-NoClobber] [-SkipDependencyCheck] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The Install-PSResource cmdlet combines the Install-Module and Install-Script cmdlets from V2. +It installs a resource from a registered repository to an installation path on a machine based on the -Name parameter argument. It does not return any object. Other parameters allow the resource to be specified by repository and version, and allow the user to suppress prompts or specify the scope of installation. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Install-PSResource Az +``` + +Installs the Az module. + +### Example 2 +```powershell +PS C:\> Install-PSResource Az -Version "[2.0.0, 3.0.0]" +``` + +Installs the latest stable Az module that is within the range 2.0.0 and 3.0.0. + +### Example 3 +```powershell +PS C:\> Install-PSResource Az -Repository PSGallery +``` + +Installs the latest stable Az module from the PowerShellGallery. + + +### Example 3 +```powershell +PS C:\> Install-PSResource Az -Reinstall +``` + +Installs the Az module and will write over any previously installed version if it is already installed. + +## PARAMETERS + +### -Name +Name of a resource or resources to install. Does not accept wildcard characters or a null value. + +```yaml +Type: System.String[] +Parameter Sets: NameParameterSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Version +Specifies the version of the resource to be installed. The value can be an exact version or a version +range using the NuGet versioning syntax. + +For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) + +PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range +documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher +(minimum inclusive range). Instead, the values is considered as the required version and yields +version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as +the version range. + +```yaml +Type: System.String +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Prerelease +When specified, includes prerelease versions in search results returned. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Repository +Specifies one or more repository names to search. +If not specified, search will include all currently registered repositories, in order of highest priority, until first repository package is found in. + +```yaml +Type: System.String[] +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Credential +Optional credentials to be used when accessing a repository. + +```yaml +Type: System.Management.Automation.PSCredential +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +Specifies the scope under which a user has access. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ScopeType +Parameter Sets: (All) +Aliases: +Accepted values: CurrentUser, AllUsers + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TrustRepository +Suppress prompts to trust repository. The prompt to trust repository only occurs if the repository is not already set to a trusted level. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Reinstall +Writes over any previously installed resource version that already exists on the machine. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Quiet +Supresses installation progress bar. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AcceptLicense +Specifies that the resource should accept any request to accept license. This will suppress prompting if the module mandates that a user accept their license. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoClobber +Prevents installing a package that contains cmdlets that already exist on the machine. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipDependencyCheck +Skips the check for resource dependencies, so that only found resources are installed, and not any resources the found resource depends on. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Passes the resource installed to the console. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Used for pipeline input. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## OUTPUTS +None + +## NOTES + +## RELATED LINKS \ No newline at end of file diff --git a/help/PowerShellGet.md b/help/PowerShellGet.md new file mode 100644 index 0000000..548aaf5 --- /dev/null +++ b/help/PowerShellGet.md @@ -0,0 +1,46 @@ +--- +Module Name: PowerShellGet +Module Guid: 1d73a601-4a6c-43c5-ba3f-619b18bbb404 +Download Help Link: {{ Update Download Link }} +Help Version: {{ Please enter version of help manually (X.X.X.X) format }} +Locale: en-US +--- + +# PowerShellGet Module +## Description +{{ Fill in the Description }} + +## PowerShellGet Cmdlets +### [Find-PSResource](Find-PSResource.md) +{{ Fill in the Description }} + +### [Get-PSResource](Get-PSResource.md) +{{ Fill in the Description }} + +### [Get-PSResourceRepository](Get-PSResourceRepository.md) +{{ Fill in the Description }} + +### [Install-PSResource](Install-PSResource.md) +{{ Fill in the Description }} + +### [Publish-PSResource](Publish-PSResource.md) +{{ Fill in the Description }} + +### [Register-PSResourceRepository](Register-PSResourceRepository.md) +{{ Fill in the Description }} + +### [Save-PSResource](Save-PSResource.md) +{{ Fill in the Description }} + +### [Set-PSResourceRepository](Set-PSResourceRepository.md) +{{ Fill in the Description }} + +### [Uninstall-PSResource](Uninstall-PSResource.md) +{{ Fill in the Description }} + +### [Unregister-PSResourceRepository](Unregister-PSResourceRepository.md) +{{ Fill in the Description }} + +### [Update-PSResource](Update-PSResource.md) +{{ Fill in the Description }} + diff --git a/help/Publish-PSResource.md b/help/Publish-PSResource.md new file mode 100644 index 0000000..8c74c9d --- /dev/null +++ b/help/Publish-PSResource.md @@ -0,0 +1,175 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Publish-PSResource + +## SYNOPSIS +Publishes a specified module from the local computer to PSResource repository. + +## SYNTAX + +``` +Publish-PSResource [-APIKey ] [-Repository ] [-Path] [-DestinationPath] + [-Credential ] [-SkipDependenciesCheck] + [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The Publish-PSResource cmdlet combines the Publish-Module and Publish-Script cmdlets from V2. +It publishes a specified resource from the local computer to an online Nuget-based gallery by using an API key, stored as part of a user's profile in the gallery or to a local repository. +You can specify the resource to publish either by the resource's name, or by the path to the folder containing the module or script resource. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Publish-PSResource -Path c:\Test-Module +``` + +This will publish the module 'Test-Module' to the highest priority repository + +### Example 2 +```powershell +PS C:\> Publish-PSResource -Path c:\Test-Module -Repository PSGallery -APIKey '1234567' +``` + +This will publish the module 'Test-Module' to the PowerShellGallery. Note that the API key is a secret that is generated for a user from the website itself. + +## PARAMETERS + +### -APIKey +Specifies the API key that you want to use to publish a resource to the online gallery. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Repository +Specifies the repository to publish to. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Path +When specified, includes prerelease versions in search. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationPath +Specifies the path to where the resource (as a nupkg) should be saved to. This parameter can be used in conjunction with the -Repository parameter to publish to a repository and also save the exact same package to the local file system. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Credential +Specifies a user account that has rights to a specific repository (used for finding dependencies). + +```yaml +Type: System.Management.Automation.PSCredential +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipDependenciesCheck +Bypasses the default check that all dependencies are present on the repository which the resource is being published to. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + + +## OUTPUTS +None + +## NOTES + +## RELATED LINKS + diff --git a/help/Register-PSResourceRepository.md b/help/Register-PSResourceRepository.md new file mode 100644 index 0000000..bf90cb3 --- /dev/null +++ b/help/Register-PSResourceRepository.md @@ -0,0 +1,232 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Register-PSResourceRepository + +## SYNOPSIS +Registers a repository for PowerShell resources. + +## SYNTAX + +### NameParameterSet (Default) +``` +Register-PSResourceRepository [-Name] [-URL] [-Trusted] [-Priority ] [-PassThru] + [-WhatIf] [-Confirm] [] +``` + +### PSGalleryParameterSet +``` +Register-PSResourceRepository [-PSGallery] [-Trusted] [-Priority ] [-PassThru] [-WhatIf] [-Confirm] + [] +``` + +### RepositoriesParameterSet +``` +Register-PSResourceRepository -Repositories [-PassThru] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The Register-PSResourceRepository cmdlet registers a repository for PowerShell resources. + +## EXAMPLES +These examples assume that the repository we attempt to register is not already registered on the user's machine. +### Example 1 +``` +PS C:\> Register-PSResourceRepository -Name "PoshTestGallery" -URL "https://www.powershellgallery.com/api/v2" +PS C:\> Get-PSResourceRepository -Name "PoshTestGallery" + Name Url Trusted Priority + ---- --- ------- -------- + PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50 +``` + +This example registers the repository with the `-Name` of "PoshTestGallery" along with the associated `URL` value for it. + +### Example 2 +``` +PS C:\> Register-PSResourceRepository -PSGallery +PS C:\> Get-PSResourceRepository -Name "PSGallery" + Name Url Trusted Priority + ---- --- ------- -------- + PSGallery https://www.powershellgallery.com/api/v2 False 50 +``` + +This example registers the "PSGallery" repository, with the 'PSGallery' parameter. Unlike the previous example, we cannot use the `-Name` or `-URL` parameters to register the "PSGallery" repository as it is considered Powershell's default repository store and has its own value for URL. + +### Example 3 +``` +PS C:\> $arrayOfHashtables = @{Name = "psgettestlocal"; URL = "c:/code/testdir"},@{PSGallery = $True} +PS C:\> Register-PSResourceRepository -Repositories $arrayOfHashtables +PS C:\> Get-PSResourceRepository + Name Url Trusted Priority + ---- --- ------- -------- + PSGallery https://www.powershellgallery.com/api/v2 False 50 + psgettestlocal file:///c:/code/testdir False 50 + +``` + +This example registers multiple repositories at once. To do so, we use the `-Repositories` parameter and provide an array of hashtables. Each hashtable can only have keys associated with parameters for the NameParameterSet or the PSGalleryParameterSet. Upon running the command we can see that the "psgettestlocal" and "PSGallery" repositories have been succesfully registered. + +## PARAMETERS + +### -Name +Name of the repository to be registered. +Cannot be "PSGallery". + +```yaml +Type: String +Parameter Sets: NameParameterSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Priority +Specifies the priority ranking of the repository. +Repositories with higher ranking priority are searched before a lower ranking priority one, when searching for a repository item across multiple registered repositories. Valid priority values range from 0 to 50, such that a lower numeric value (i.e 10) corresponds to a higher priority ranking than a higher numeric value (i.e 40). Has default value of 50. + +```yaml +Type: Int32 +Parameter Sets: NameParameterSet, PSGalleryParameterSet +Aliases: + +Required: False +Position: Named +Default value: 50 +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PSGallery +When specified, registers PSGallery repository. + +```yaml +Type: SwitchParameter +Parameter Sets: PSGalleryParameterSet +Aliases: + +Required: True +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Repositories +Specifies an array of hashtables which contains repository information and is used to register multiple repositories at once. + +```yaml +Type: Hashtable[] +Parameter Sets: RepositoriesParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Trusted +Specifies whether the repository should be trusted. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -URL +Specifies the location of the repository to be registered. +URL can be of the following Uri schemas: HTTPS, HTTP, FTP, file share based. + +```yaml +Type: String +Parameter Sets: NameParameterSet +Aliases: + +Required: True +Position: 1 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +When specified, displays the succcessfully registered repository and its information. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter is used) + +## NOTES +Repositories are unique by 'Name'. Attempting to register a repository with same 'Name' as an already registered repository will not successfully register. + +Registering the PSGallery repository must be done via the PSGalleryParameterSet (i.e by using the 'PSGallery' parameter instead of 'Name' and 'URL' parameters). + +URL string input must be of one of the following Uri schemes: HTTP, HTTPS, FTP, File + +## RELATED LINKS diff --git a/help/Save-PSResource.md b/help/Save-PSResource.md new file mode 100644 index 0000000..8e9f667 --- /dev/null +++ b/help/Save-PSResource.md @@ -0,0 +1,304 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Save-PSResource + +## SYNOPSIS +Saves resources (modules and scripts) from a registered repository onto the machine. + +## SYNTAX + +### NameParameterSet +``` +Save-PSResource [-Name] [-Version ] [-Prerelease] [-Repository ] + [-Credential ] [-AsNupkg] [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [] +``` + +### InputObjectParameterSet +``` +Save-PSResource [-InputObject] [-Credential ] [-AsNupkg] + [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The Save-PSResource cmdlet combines the Save-Module and Save-Script cmdlets from V2. +It saves a resource from a registered repository to a specific path on a machine based on the -Name parameter argument. It does not return any object. Other parameters allow the resource to be specified by repository and version, and allow the user to save the resource as a .nupkg or with the PowerShellGet XML metadata. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Save-PSResource -Name Az +``` +Saves the Az module + +### Example 2 +```powershell +PS C:\> Save-PSResource -Name Az -Repository PSGallery +``` +Saves the Az module found in the PowerShellGallery + +### Example 3 +```powershell +PS C:\> Save-PSResource Az -AsNupkg +``` +Saves the Az module as a .nupkg file + +### Example 4 +```powershell +PS C:\> Save-PSResource Az -IncludeXML +``` +Saves the Az module and includes the PowerShellGet XML metadata + +## PARAMETERS + +### -Name +Name of a resource or resources to save. Does not accept wildcard characters or a null value. + +```yaml +Type: System.String[] +Parameter Sets: NameParameterSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Version +Specifies the version of the resource to be saved. The value can be an exact version or a version +range using the NuGet versioning syntax. + +For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) + +PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range +documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher +(minimum inclusive range). Instead, the values is considered as the required version and yields +version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as +the version range. + +```yaml +Type: System.String +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Prerelease +Specifies to include prerelease versions. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Repository +Specifies one or more repository names to search. +If not specified, search will include all currently registered repositories, in order of highest priority, until first repository package is found in. + +```yaml +Type: System.String[] +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Credential +Optional credentials to be used when accessing a repository. + +```yaml +Type: System.Management.Automation.PSCredential +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsNupkg +Saves the resource as a zipped .nupkg file. +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IncludeXML +Includes the PowerShellGet metadata XML (used to verify that PowerShellGet has installed a module). + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Path +Specifies the path to save the resource to. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -TrustRepository +Suppress prompts to trust repository. The prompt to trust repository only occurs if the repository is not already set to a trusted level. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Passes the resource saved to the console. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipDependencyCheck +Skips the check for resource dependencies, so that only found resources are saved, and not any resources the found resource depends on. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Quiet +Supresses progress information. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Used for pipeline input. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS +None + +## NOTES + +## RELATED LINKS diff --git a/help/Set-PSResourceRepository.md b/help/Set-PSResourceRepository.md new file mode 100644 index 0000000..b65cabe --- /dev/null +++ b/help/Set-PSResourceRepository.md @@ -0,0 +1,200 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Set-PSResourceRepository + +## SYNOPSIS +Sets information for a registered repository. + +## SYNTAX + +### NameParameterSet (Default) +``` +Set-PSResourceRepository [-Name] [-URL ] [-Trusted] [-Priority ] [-WhatIf] [-Confirm] [] +``` + +### RepositoriesParameterSet +``` +Set-PSResourceRepository -Repositories [-Priority ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The Set-PSResourceRepository cmdlet sets information for a registered repository. + +## EXAMPLES +These examples are run independently of each other and assume the repositories used are already registered. The `-PassThru` parameter used with Set-PSResourceRepository is only used to display the changes made to the repository and is not mandatory. +### Example 1 +```powershell +PS C:\> Get-PSResourceRepository -Name "PoshTestGallery" + Name Url Trusted Priority + ---- --- ------- -------- + PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50 +PS C:\> Set-PSResourceRepository -Name "PoshTestGallery" -URL "c:/code/testdir" -PassThru + Name Url Trusted Priority + ---- --- ------- -------- + PoshTestGallery file:///c:/code/testdir False 50 +``` + +This example first checks if the PoshTestGallery repository has been registered. We wish to set the `-URL` value of this repository by running the Set-PSResourceRepository cmdlet with the `-URL` parameter and a valid Uri scheme url. We run the Get-PSResourceRepository cmdlet again to ensure that the `-URL` of the repository was changed. We also use the `-PassThru` parameter to see the changed repository. + +### Example 2 +```powershell +PS C:\> Get-PSResourceRepository -Name "PSGallery" + Name Url Trusted Priority + ---- --- ------- -------- + PSGallery https://www.powershellgallery.com/api/v2 False 50 +PS C:\> Set-PSResourceRepository -Name "PSGallery" -Priority 25 -Trusted -PassThru + Name Url Trusted Priority + ---- --- ------- -------- + PSGallery https://www.powershellgallery.com/api/v2 True 25 +``` + +This example first checks if the PSGallery repository has been registered. We wish to set the `-Priority` and `-Trusted` values of this repository by running the Set-PSResourceRepository cmdlet with the `-Priority` parameter set to a value between 0 and 50 and by using the `-Trusted` parameter switch. We run the Get-PSResourceRepository cmdlet again to ensure that the `-Priority` and `-Trusted` values of the repository were changed. An important note here is that just for the default PSGallery repository, the `-URL` value can't be changed/set. We also use the `-PassThru` parameter to see the changed repository. + +### Example 3 +```powershell +PS C:\> Get-PSResourceRepository -Name "*" + Name Url Trusted Priority + ---- --- ------- -------- + PSGallery https://www.powershellgallery.com/api/v2 False 50 + PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50 + +PS C:\> $arrayOfHashtables = @{Name = "PSGallery"; Trusted = $True},@{Name = "PoshTestGallery"; URL = "c:/code/testdir"} + +PS C:\> Set-PSResourceRepository -Repositories $arrayOfHashtables -PassThru + Name Url Trusted Priority + ---- --- ------- -------- + PSGallery https://www.powershellgallery.com/api/v2 True 50 + PoshTestGallery file:///c:/code/testdir False 50 +``` + +This example first checks for all registered repositories. We wish to set the properties for multiple repositories at once (i.e the PSGallery and PoshTestGallery repositories), so we run Set-PSResourceRepository with the `-Repositories` parameter. This parameter takes an array of hashtables, where each hashtable contains information for a repository we wish to set information for. We also use the `-PassThru` parameter to see the changed repositories. + +## PARAMETERS + +### -Name +Specifies the name of the repository to be set. + +```yaml +Type: System.String +Parameter Sets: NameParameterSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Priority +Specifies the priority ranking of the repository, such that repositories with higher ranking priority are searched before a lower ranking priority one, when searching for a repository item across multiple registered repositories. Valid priority values range from 0 to 50, such that a lower numeric value (i.e 10) corresponds to a higher priority ranking than a higher numeric value (i.e 40). + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Trusted +Specifies whether the repository should be trusted. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -URL +Specifies the location of the repository to be set. + +```yaml +Type: String +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +When specified, displays the succcessfully registered repository and its information + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### System.Collections.Hashtable[] + +## OUTPUTS + +### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter used) + +## NOTES + +## RELATED LINKS diff --git a/help/Uninstall-PSResource.md b/help/Uninstall-PSResource.md new file mode 100644 index 0000000..6bfdef5 --- /dev/null +++ b/help/Uninstall-PSResource.md @@ -0,0 +1,142 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Uninstall-PSResource + +## SYNOPSIS +Uninstalls a resource (module or script) that has been installed on the machine via PowerShellGet. + +## SYNTAX + +### NameParameterSet +``` +Uninstall-PSResource [-Name] [-Version ] [-SkipDependencyCheck] [-WhatIf] [] +``` + +### InputObjectParameterSet +``` +Uninstall-PSResource [-InputObject] [-SkipDependencyCheck] [-WhatIf] [] +``` + +## DESCRIPTION +The Uninstall-PSResource cmdlet combines the Uninstall-Module, Uninstall-Script cmdlets from V2. +It uninstalls a package found in a module or script installation path based on the -Name parameter argument. +It does not return an object. +Other parameters allow the returned results to be further filtered. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Uninstall-PSResource Az +``` + +Uninstalls the latest version of the Az module. + +### Example 2 +```powershell +PS C:\> Uninstall-PSResource -name Az -version "1.0.0" +``` + +Uninstalls version 1.0.0 of the Az module. + +### Example 3 +```powershell +PS C:\> Uninstall-PSResource -name Az -version "(1.0.0, 3.0.0)" + +Uninstalls all versions within the specified version range. +``` + +Uninstalls version 1.0.0 of the Az module. + +## PARAMETERS + +### -Name +Name of a resource or resources that has been installed. Accepts wild card characters. + +```yaml +Type: System.String[] +Parameter Sets: NameParameterSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: True +``` + +### -Version +Specifies the version of the resource to be uninstalled. + +```yaml +Type: System.String +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True +Accept wildcard characters: False +``` + +### -SkipDependencyCheck +Skips check to see if other resources are dependent on the resource being uninstalled. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Used for pipeline input. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## OUTPUTS +None + +## NOTES + +## RELATED LINKS diff --git a/help/Unregister-PSResourceRepository.md b/help/Unregister-PSResourceRepository.md new file mode 100644 index 0000000..764a5eb --- /dev/null +++ b/help/Unregister-PSResourceRepository.md @@ -0,0 +1,131 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Unregister-PSResourceRepository + +## SYNOPSIS +Un-registers a repository from the repository store. + +## SYNTAX + +### NameParameterSet +``` +Unregister-PSResourceRepository [-Name] [-PassThru][-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The Unregister-PSResourceRepository cmdlet unregisters a repository. + +## EXAMPLES + +### Example 1 +``` +PS C:\> Get-PSResourceRepository -Name "PoshTestGallery" +PS C:\> Unregister-PSResourceRepository -Name "PoshTestGallery" +PS C:\> Get-PSResourceRepository -Name "PoshTestGallery" +PS C:\> + +``` + +In this example, we assume the repository "PoshTestGallery" has been previously registered. So when we first run the command to find "PoshTestGallery" it verifies that this repository can be found. Next, we run the command to unregister "PoshTestGallery". Finally, we again run the command to find "PoshTestGallery" but since it was successfully un-registered it cannot be found or retrieved. + +### Example 2 +``` +PS C:\> Get-PSResourceRepository + Name Url Trusted Priority + ---- --- ------- -------- + PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40 + PSGallery https://www.powershellgallery.com/api/v2 False 50 + psgettestlocal file:///c:/code/testdir True 50 + +PS C:\> Unregister-PSResourceRepository -Name "PoshTestGallery","psgettestlocal" +PS C:\> Get-PSResourceRepository + Name Url Trusted Priority + ---- --- ------- -------- + PSGallery https://www.powershellgallery.com/api/v2 False 50 + +``` + +In this example, the command to find all registered repositories is run and the repositories found are displayed. Next, the command to un-register is run with a list of names ("PoshTestGallery", "psgettestlocal") provided for the `-Name` parameter. Finally, the command to find all registered repositories is run again, but this time we can see that "PoshTestGallery" and "psgettestlocal" are not found and displayed as they have been successfully unregistered. + +## PARAMETERS + +### -Name +This parameter takes a String argument, or an array of String arguments. It is the name of the repository to un-register. + +```yaml +Type: String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Passes the resource installed to the console. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String[] + +## OUTPUTS + +None + +## NOTES + +## RELATED LINKS diff --git a/help/Update-PSResource.md b/help/Update-PSResource.md new file mode 100644 index 0000000..167a606 --- /dev/null +++ b/help/Update-PSResource.md @@ -0,0 +1,284 @@ +--- +external help file: PowerShellGet.dll-Help.xml +Module Name: PowerShellGet +online version: +schema: 2.0.0 +--- + +# Update-PSResource + +## SYNOPSIS +Updates a package already installed on the user's machine. + +## SYNTAX + +### NameParameterSet (Default) +``` +Update-PSResource [-Name] [-Version ] [-Prerelease] [-Repository ] + [-Scope ] [-TrustRepository] [-Credential ] [-Quiet] [-AcceptLicense] [-Force] [-PassThru] [-SkipDependencyCheck] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The Update-PSResource cmdlet replaces the Update-Module and Update-Script cmdlets from V2. +It updates an already installed package based on the `-Name` parameter argument. +It does not return an object. Other parameters allow the package to be updated to be further filtered. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Update-PSResource -Name "TestModule" + Name Version Prerelease Description + ---- ------- ---------- ----------- + TestModule 1.2.0 test + +PS C:\> Update-PSResource -Name "TestModule" + +PS C:\> Update-PSResource -Name "TestModule" + Name Version Prerelease Description + ---- ------- ---------- ----------- + TestModule 1.3.0 test + TestModule 1.2.0 test + +``` + +In this example, the user already has the TestModule package installed and they update the package. Update-PSResource will install the latest version of the package without deleting the older version installed. + +## PARAMETERS + +### -AcceptLicense +For resources that require a license, AcceptLicense automatically accepts the license agreement during the update. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Credential +Specifies optional credentials to be used when accessing a private repository. + +```yaml +Type: System.Management.Automation.PSCredential +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Specifies name of a resource or resources to update. + +```yaml +Type: System.String[] +Parameter Sets: NameParameterSet +Aliases: + +Required: True +Position: 0 +Default value: "*" +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: True +``` + +### -Prerelease +When specified, allows updating to a prerelease version. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Quiet +Supresses progress information. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Repository +Specifies one or more repository names to update packages from. +If not specified, search for packages to update will include all currently registered repositories in order of highest priority. + +```yaml +Type: System.String[] +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Scope +Specifies the scope of the resource to update. + +```yaml +Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ScopeType +Parameter Sets: (All) +Aliases: +Accepted values: CurrentUser, AllUsers + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TrustRepository +Specifies optional credentials to be used when accessing a private repository. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Version +Specifies the version of the resource to be updated to. The value can be an exact version or a version +range using the NuGet versioning syntax. + +For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) + +PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range +documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher +(minimum inclusive range). Instead, the values is considered as the required version and yields +version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as +the version range. + +```yaml +Type: System.String +Parameter Sets: NameParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +When specified, bypasses checks for TrustRepository and AcceptLicense and updates the package. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Passes the resource updated to the console. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkipdependencyCheck +Skips the check for resource dependencies, so that only found resources are updated, and not any resources the found resource depends on. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String[] + +## OUTPUTS + +## NOTES + +## RELATED LINKS + +[]() diff --git a/help/en-US/PowerShellGet.dll-Help.xml b/help/en-US/PowerShellGet.dll-Help.xml new file mode 100644 index 0000000..5e215e5 --- /dev/null +++ b/help/en-US/PowerShellGet.dll-Help.xml @@ -0,0 +1,4041 @@ +īģŋ + + + + Find-PSResource + Find + PSResource + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Find-PSResource + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + IncludeDependencies + + {{ Fill IncludeDependencies Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + ModuleName + + {{ Fill ModuleName Description }} + + System.String + + System.String + + + None + + + Prerelease + + {{ Fill Prerelease Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + Tags + + {{ Fill Tags Description }} + + System.String[] + + System.String[] + + + None + + + Type + + {{ Fill Type Description }} + + + Module + Script + DscResource + RoleCapability + Command + + System.String[] + + System.String[] + + + None + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + IncludeDependencies + + {{ Fill IncludeDependencies Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ModuleName + + {{ Fill ModuleName Description }} + + System.String + + System.String + + + None + + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Prerelease + + {{ Fill Prerelease Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + Tags + + {{ Fill Tags Description }} + + System.String[] + + System.String[] + + + None + + + Type + + {{ Fill Type Description }} + + System.String[] + + System.String[] + + + None + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String[] + + + + + + + + System.String + + + + + + + + System.Management.Automation.PSCredential + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Get-PSResource + Get + PSResource + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Get-PSResource + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Path + + {{ Fill Path Description }} + + System.String + + System.String + + + None + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Path + + {{ Fill Path Description }} + + System.String + + System.String + + + None + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String[] + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Get-PSResourceRepository + Get + PSResourceRepository + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Get-PSResourceRepository + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String[] + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Install-PSResource + Install + PSResource + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Install-PSResource + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + AcceptLicense + + {{ Fill AcceptLicense Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + NoClobber + + {{ Fill NoClobber Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Prerelease + + {{ Fill Prerelease Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Quiet + + {{ Fill Quiet Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Reinstall + + {{ Fill Reinstall Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + Scope + + {{ Fill Scope Description }} + + + CurrentUser + AllUsers + + System.String + + System.String + + + None + + + TrustRepository + + {{ Fill TrustRepository Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Type + + {{ Fill Type Description }} + + System.String[] + + System.String[] + + + None + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Install-PSResource + + AcceptLicense + + {{ Fill AcceptLicense Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + NoClobber + + {{ Fill NoClobber Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Prerelease + + {{ Fill Prerelease Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Quiet + + {{ Fill Quiet Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Reinstall + + {{ Fill Reinstall Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + RequiredResourceFile + + {{ Fill RequiredResourceFile Description }} + + System.String + + System.String + + + None + + + Scope + + {{ Fill Scope Description }} + + + CurrentUser + AllUsers + + System.String + + System.String + + + None + + + TrustRepository + + {{ Fill TrustRepository Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Type + + {{ Fill Type Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Install-PSResource + + InputObject + + {{ Fill InputObject Description }} + + System.Object[] + + System.Object[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Install-PSResource + + RequiredResource + + {{ Fill RequiredResource Description }} + + System.Object + + System.Object + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AcceptLicense + + {{ Fill AcceptLicense Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + InputObject + + {{ Fill InputObject Description }} + + System.Object[] + + System.Object[] + + + None + + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + NoClobber + + {{ Fill NoClobber Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Prerelease + + {{ Fill Prerelease Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Quiet + + {{ Fill Quiet Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Reinstall + + {{ Fill Reinstall Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + RequiredResource + + {{ Fill RequiredResource Description }} + + System.Object + + System.Object + + + None + + + RequiredResourceFile + + {{ Fill RequiredResourceFile Description }} + + System.String + + System.String + + + None + + + Scope + + {{ Fill Scope Description }} + + System.String + + System.String + + + None + + + TrustRepository + + {{ Fill TrustRepository Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Type + + {{ Fill Type Description }} + + System.String[] + + System.String[] + + + None + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String[] + + + + + + + + System.Object[] + + + + + + + + System.Management.Automation.PSCredential + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Publish-PSResource + Publish + PSResource + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Publish-PSResource + + Path + + {{ Fill Path Description }} + + System.String + + System.String + + + None + + + APIKey + + {{ Fill APIKey Description }} + + System.String + + System.String + + + None + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DestinationPath + + {{ Fill DestinationPath Description }} + + System.String + + System.String + + + None + + + Exclude + + {{ Fill Exclude Description }} + + System.String[] + + System.String[] + + + None + + + IconUrl + + {{ Fill IconUrl Description }} + + System.String + + System.String + + + None + + + LicenseUrl + + {{ Fill LicenseUrl Description }} + + System.String + + System.String + + + None + + + Nuspec + + {{ Fill Nuspec Description }} + + System.String + + System.String + + + None + + + ProjectUrl + + {{ Fill ProjectUrl Description }} + + System.String + + System.String + + + None + + + ReleaseNotes + + {{ Fill ReleaseNotes Description }} + + System.String + + System.String + + + None + + + Repository + + {{ Fill Repository Description }} + + System.String + + System.String + + + None + + + SkipDependenciesCheck + + {{ Fill SkipDependenciesCheck Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Tags + + {{ Fill Tags Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Publish-PSResource + + APIKey + + {{ Fill APIKey Description }} + + System.String + + System.String + + + None + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DestinationPath + + {{ Fill DestinationPath Description }} + + System.String + + System.String + + + None + + + Exclude + + {{ Fill Exclude Description }} + + System.String[] + + System.String[] + + + None + + + IconUrl + + {{ Fill IconUrl Description }} + + System.String + + System.String + + + None + + + LicenseUrl + + {{ Fill LicenseUrl Description }} + + System.String + + System.String + + + None + + + LiteralPath + + {{ Fill LiteralPath Description }} + + System.String + + System.String + + + None + + + Nuspec + + {{ Fill Nuspec Description }} + + System.String + + System.String + + + None + + + ProjectUrl + + {{ Fill ProjectUrl Description }} + + System.String + + System.String + + + None + + + ReleaseNotes + + {{ Fill ReleaseNotes Description }} + + System.String + + System.String + + + None + + + Repository + + {{ Fill Repository Description }} + + System.String + + System.String + + + None + + + SkipDependenciesCheck + + {{ Fill SkipDependenciesCheck Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Tags + + {{ Fill Tags Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Publish-PSResource + + APIKey + + {{ Fill APIKey Description }} + + System.String + + System.String + + + None + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DestinationPath + + {{ Fill DestinationPath Description }} + + System.String + + System.String + + + None + + + Exclude + + {{ Fill Exclude Description }} + + System.String[] + + System.String[] + + + None + + + IconUrl + + {{ Fill IconUrl Description }} + + System.String + + System.String + + + None + + + LicenseUrl + + {{ Fill LicenseUrl Description }} + + System.String + + System.String + + + None + + + ProjectUrl + + {{ Fill ProjectUrl Description }} + + System.String + + System.String + + + None + + + ReleaseNotes + + {{ Fill ReleaseNotes Description }} + + System.String + + System.String + + + None + + + Repository + + {{ Fill Repository Description }} + + System.String + + System.String + + + None + + + SkipDependenciesCheck + + {{ Fill SkipDependenciesCheck Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Tags + + {{ Fill Tags Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Publish-PSResource + + APIKey + + {{ Fill APIKey Description }} + + System.String + + System.String + + + None + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DestinationPath + + {{ Fill DestinationPath Description }} + + System.String + + System.String + + + None + + + Exclude + + {{ Fill Exclude Description }} + + System.String[] + + System.String[] + + + None + + + Nuspec + + {{ Fill Nuspec Description }} + + System.String + + System.String + + + None + + + Repository + + {{ Fill Repository Description }} + + System.String + + System.String + + + None + + + SkipDependenciesCheck + + {{ Fill SkipDependenciesCheck Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + APIKey + + {{ Fill APIKey Description }} + + System.String + + System.String + + + None + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DestinationPath + + {{ Fill DestinationPath Description }} + + System.String + + System.String + + + None + + + Exclude + + {{ Fill Exclude Description }} + + System.String[] + + System.String[] + + + None + + + IconUrl + + {{ Fill IconUrl Description }} + + System.String + + System.String + + + None + + + LicenseUrl + + {{ Fill LicenseUrl Description }} + + System.String + + System.String + + + None + + + LiteralPath + + {{ Fill LiteralPath Description }} + + System.String + + System.String + + + None + + + Nuspec + + {{ Fill Nuspec Description }} + + System.String + + System.String + + + None + + + Path + + {{ Fill Path Description }} + + System.String + + System.String + + + None + + + ProjectUrl + + {{ Fill ProjectUrl Description }} + + System.String + + System.String + + + None + + + ReleaseNotes + + {{ Fill ReleaseNotes Description }} + + System.String + + System.String + + + None + + + Repository + + {{ Fill Repository Description }} + + System.String + + System.String + + + None + + + SkipDependenciesCheck + + {{ Fill SkipDependenciesCheck Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Tags + + {{ Fill Tags Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Register-PSResourceRepository + Register + PSResourceRepository + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Register-PSResourceRepository + + Name + + {{ Fill Name Description }} + + System.String + + System.String + + + None + + + URL + + {{ Fill URL Description }} + + System.Uri + + System.Uri + + + None + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Priority + + {{ Fill Priority Description }} + + System.Int32 + + System.Int32 + + + None + + + Proxy + + {{ Fill Proxy Description }} + + System.Uri + + System.Uri + + + None + + + ProxyCredential + + {{ Fill ProxyCredential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Trusted + + {{ Fill Trusted Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Register-PSResourceRepository + + Priority + + {{ Fill Priority Description }} + + System.Int32 + + System.Int32 + + + None + + + Proxy + + {{ Fill Proxy Description }} + + System.Uri + + System.Uri + + + None + + + ProxyCredential + + {{ Fill ProxyCredential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + PSGallery + + {{ Fill PSGallery Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Trusted + + {{ Fill Trusted Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Register-PSResourceRepository + + Proxy + + {{ Fill Proxy Description }} + + System.Uri + + System.Uri + + + None + + + ProxyCredential + + {{ Fill ProxyCredential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Repositories + + {{ Fill Repositories Description }} + + System.Collections.Generic.List`1[System.Collections.Hashtable] + + System.Collections.Generic.List`1[System.Collections.Hashtable] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Name + + {{ Fill Name Description }} + + System.String + + System.String + + + None + + + Priority + + {{ Fill Priority Description }} + + System.Int32 + + System.Int32 + + + None + + + Proxy + + {{ Fill Proxy Description }} + + System.Uri + + System.Uri + + + None + + + ProxyCredential + + {{ Fill ProxyCredential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + PSGallery + + {{ Fill PSGallery Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Repositories + + {{ Fill Repositories Description }} + + System.Collections.Generic.List`1[System.Collections.Hashtable] + + System.Collections.Generic.List`1[System.Collections.Hashtable] + + + None + + + Trusted + + {{ Fill Trusted Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + URL + + {{ Fill URL Description }} + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.PSCredential + + + + + + + + System.Uri + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Save-PSResource + Save + PSResource + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Save-PSResource + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + AsNupkg + + {{ Fill AsNupkg Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + IncludeXML + + {{ Fill IncludeXML Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Path + + {{ Fill Path Description }} + + System.String + + System.String + + + None + + + Prerelease + + {{ Fill Prerelease Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AsNupkg + + {{ Fill AsNupkg Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + IncludeXML + + {{ Fill IncludeXML Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Path + + {{ Fill Path Description }} + + System.String + + System.String + + + None + + + Prerelease + + {{ Fill Prerelease Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String[] + + + + + + + + System.Management.Automation.PSCredential + + + + + + + + System.String + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Set-PSResourceRepository + Set + PSResourceRepository + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Set-PSResourceRepository + + Name + + {{ Fill Name Description }} + + System.String + + System.String + + + None + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Priority + + {{ Fill Priority Description }} + + System.Int32 + + System.Int32 + + + None + + + Proxy + + {{ Fill Proxy Description }} + + System.Uri + + System.Uri + + + None + + + ProxyCredential + + {{ Fill ProxyCredential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Trusted + + {{ Fill Trusted Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + URL + + {{ Fill URL Description }} + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-PSResourceRepository + + Priority + + {{ Fill Priority Description }} + + System.Int32 + + System.Int32 + + + None + + + Proxy + + {{ Fill Proxy Description }} + + System.Uri + + System.Uri + + + None + + + ProxyCredential + + {{ Fill ProxyCredential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Repositories + + {{ Fill Repositories Description }} + + System.Collections.Generic.List`1[System.Collections.Hashtable] + + System.Collections.Generic.List`1[System.Collections.Hashtable] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Name + + {{ Fill Name Description }} + + System.String + + System.String + + + None + + + Priority + + {{ Fill Priority Description }} + + System.Int32 + + System.Int32 + + + None + + + Proxy + + {{ Fill Proxy Description }} + + System.Uri + + System.Uri + + + None + + + ProxyCredential + + {{ Fill ProxyCredential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Repositories + + {{ Fill Repositories Description }} + + System.Collections.Generic.List`1[System.Collections.Hashtable] + + System.Collections.Generic.List`1[System.Collections.Hashtable] + + + None + + + Trusted + + {{ Fill Trusted Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + URL + + {{ Fill URL Description }} + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Uri + + + + + + + + System.Management.Automation.PSCredential + + + + + + + + System.Collections.Generic.List`1[[System.Collections.Hashtable, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + + + + + + + + System.Int32 + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Uninstall-PSResource + Uninstall + PSResource + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Uninstall-PSResource + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Force + + {{ Fill Force Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + PrereleaseOnly + + {{ Fill PrereleaseOnly Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Force + + {{ Fill Force Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + PrereleaseOnly + + {{ Fill PrereleaseOnly Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String[] + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Unregister-PSResourceRepository + Unregister + PSResourceRepository + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Unregister-PSResourceRepository + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String[] + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + + + Update-PSResource + Update + PSResource + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Update-PSResource + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + AcceptLicense + + {{ Fill AcceptLicense Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + NoClobber + + {{ Fill NoClobber Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Prerelease + + {{ Fill Prerelease Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Quiet + + {{ Fill Quiet Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + Scope + + {{ Fill Scope Description }} + + + CurrentUser + AllUsers + + System.String + + System.String + + + None + + + TrustRepository + + {{ Fill TrustRepository Description }} + + + System.Management.Automation.SwitchParameter + + + False + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AcceptLicense + + {{ Fill AcceptLicense Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Credential + + {{ Fill Credential Description }} + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + Name + + {{ Fill Name Description }} + + System.String[] + + System.String[] + + + None + + + NoClobber + + {{ Fill NoClobber Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Prerelease + + {{ Fill Prerelease Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Quiet + + {{ Fill Quiet Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Repository + + {{ Fill Repository Description }} + + System.String[] + + System.String[] + + + None + + + Scope + + {{ Fill Scope Description }} + + System.String + + System.String + + + None + + + TrustRepository + + {{ Fill TrustRepository Description }} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Version + + {{ Fill Version Description }} + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String[] + + + + + + + + System.Management.Automation.PSCredential + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + <add> + + + + + diff --git a/nuget.config b/nuget.config new file mode 100644 index 0000000..6548586 --- /dev/null +++ b/nuget.config @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/pspackageproject.json b/pspackageproject.json new file mode 100644 index 0000000..72ab4d3 --- /dev/null +++ b/pspackageproject.json @@ -0,0 +1,9 @@ +{ + "ModuleName": "PowerShellGetDSC", + "Culture": "en-US", + "BuildOutputPath": "out", + "SignedOutputPath": "signed", + "HelpPath": "help", + "TestPath": "test", + "SourcePath": "src" +} diff --git a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 new file mode 100644 index 0000000..2f58af1 --- /dev/null +++ b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 @@ -0,0 +1,625 @@ +# +# Copyright (c) Microsoft Corporation. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# + +$resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent + +# Import localization helper functions. +$helperName = 'PowerShellGet.LocalizationHelper' +$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" +Import-Module -Name $dscResourcesFolderFilePath + +$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_PSModule' -ScriptRoot $PSScriptRoot + +# Import resource helper functions. +$helperName = 'PowerShellGet.ResourceHelper' +$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" +Import-Module -Name $dscResourcesFolderFilePath -Force + +<# + .SYNOPSIS + This DSC resource provides a mechanism to download PowerShell modules from the PowerShell + Gallery and install it on your computer. + + Get-TargetResource returns the current state of the resource. + + .PARAMETER Name + Specifies the name of the PowerShell module to be installed or uninstalled. + + .PARAMETER Repository + Specifies the name of the module source repository where the module can be found. + + .PARAMETER Version + Provides the version of the module you want to install or uninstall. + + .PARAMETER NoClobber + Does not allow the installation of modules if other existing module on the computer have cmdlets + of the same name. + + .PARAMETER SkipPublisherCheck + Allows the installation of modules that have not been catalog signed. +#> +function Get-TargetResource { + <# + These suppressions are added because this repository have other Visual Studio Code workspace + settings than those in DscResource.Tests DSC test framework. + Only those suppression that contradict this repository guideline is added here. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-ForEachStatement', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $Name, + + [Parameter()] + [System.String] + $Repository = 'PSGallery', + + [Parameter()] + [System.String] + $Version, + + [Parameter()] + [System.Boolean] + $NoClobber, + + [Parameter()] + [System.Boolean] + $SkipPublisherCheck + ) + + $returnValue = @{ + Ensure = 'Absent' + Name = $Name + Repository = $Repository + Priority = $null + Description = $null + Guid = $null + ModuleBase = $null + ModuleType = $null + Author = $null + InstalledVersion = $null + Version = $Version + NoClobber = $NoClobber + SkipPublisherCheck = $SkipPublisherCheck + InstallationPolicy = $null + Trusted = $false + } + + Write-Verbose -Message ($localizedData.GetTargetResourceMessage -f $Name) + Write-Verbose("Name:") + + Write-Verbose("Name: $Name") + Write-Verbose("Repository: $Repository") + Write-Verbose("Version: $Version") + + $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` + -ArgumentNames ('Name', 'Repository', 'Version') + + # Get the module with the right version and repository properties. + $modules = Get-RightModule @extractedArguments -ErrorAction SilentlyContinue -WarningAction SilentlyContinue + + # If the module is found, the count > 0 + if ($modules.Count -gt 0) { + Write-Verbose -Message ($localizedData.ModuleFound -f $Name) + + # Find a module with the latest version and return its properties. + $latestModule = $modules[0] + + foreach ($module in $modules) { + if ($module.Version -gt $latestModule.Version) { + $latestModule = $module + } + } + + # Check if the repository matches. + $repositoryName = Get-ModuleRepositoryName -Module $latestModule -ErrorAction SilentlyContinue -WarningAction SilentlyContinue + + ##if ($repositoryName) { + ## $installationPolicy = Get-InstallationPolicy -RepositoryName $repositoryName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue + ##} + + ##if ($installationPolicy) { + ## $installationPolicyReturnValue = 'Trusted' + ## $Trusted = $true + ##} + ##else { + ##$installationPolicyReturnValue = 'Untrusted' + ##$Trusted = $false + ##} + + Write-Verbose("returning value") + $returnValue.Ensure = 'Present' + $returnValue.Repository = $repositoryName + $returnValue.Description = $latestModule.Description + $returnValue.Guid = $latestModule.Guid + $returnValue.ModuleBase = $latestModule.ModuleBase + $returnValue.ModuleType = $latestModule.ModuleType + $returnValue.Author = $latestModule.Author + $returnValue.InstalledVersion = $latestModule.Version + $returnValue.InstallationPolicy = $installationPolicyReturnValue + $returnValue.Trusted = $trusted + } + else { + Write-Verbose -Message ($localizedData.ModuleNotFound -f $Name) + } + + return $returnValue +} + +<# + .SYNOPSIS + This DSC resource provides a mechanism to download PowerShell modules from the PowerShell + Gallery and install it on your computer. + + Test-TargetResource validates whether the resource is currently in the desired state. + + .PARAMETER Ensure + Determines whether the module to be installed or uninstalled. + + .PARAMETER Name + Specifies the name of the PowerShell module to be installed or uninstalled. + + .PARAMETER Repository + Specifies the name of the module source repository where the module can be found. + + .PARAMETER InstallationPolicy + Determines whether you trust the source repository where the module resides. + + .PARAMETER Trusted + Determines whether you trust the source repository where the module resides. + + .PARAMETER Version + Provides the version of the module you want to install or uninstall. + + .PARAMETER NoClobber + Does not allow the installation of modules if other existing module on the computer have cmdlets + of the same name. + + .PARAMETER SkipPublisherCheck + Allows the installation of modules that have not been catalog signed. +#> +function Test-TargetResource { + <# + These suppressions are added because this repository have other Visual Studio Code workspace + settings than those in DscResource.Tests DSC test framework. + Only those suppression that contradict this repository guideline is added here. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [Parameter()] + [ValidateSet('Present', 'Absent')] + [System.String] + $Ensure = 'Present', + + [Parameter(Mandatory = $true)] + [System.String] + $Name, + + [Parameter()] + [System.String] + $Repository = 'PSGallery', + + [Parameter()] + [ValidateSet('Trusted', 'Untrusted')] + [System.String] + $InstallationPolicy = 'Untrusted', + + [Parameter()] + [System.Boolean] + $Trusted = $false, + + [Parameter()] + [System.String] + $Version, + + [Parameter()] + [System.Boolean] + $NoClobber, + + [Parameter()] + [System.Boolean] + $SkipPublisherCheck + ) + + Write-Verbose -Message ($localizedData.TestTargetResourceMessage -f $Name) + + $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` + -ArgumentNames ('Name', 'Repository', 'Version') + + $status = Get-TargetResource @extractedArguments + + # The ensure returned from Get-TargetResource is not equal to the desired $Ensure. + if ($status.Ensure -ieq $Ensure) { + Write-Verbose -Message ($localizedData.InDesiredState -f $Name) + return $true + } + else { + Write-Verbose -Message ($localizedData.NotInDesiredState -f $Name) + return $false + } +} + +<# + .SYNOPSIS + This DSC resource provides a mechanism to download PowerShell modules from the PowerShell + Gallery and install it on your computer. + + Set-TargetResource sets the resource to the desired state. "Make it so". + + .PARAMETER Ensure + Determines whether the module to be installed or uninstalled. + + .PARAMETER Name + Specifies the name of the PowerShell module to be installed or uninstalled. + + .PARAMETER Repository + Specifies the name of the module source repository where the module can be found. + + .PARAMETER InstallationPolicy + Determines whether you trust the source repository where the module resides. + + .PARAMETER Trusted + Determines whether you trust the source repository where the module resides. + + .PARAMETER Version + Provides the version of the module you want to install or uninstall. + + .PARAMETER NoClobber + Does not allow the installation of modules if other existing module on the computer have cmdlets + of the same name. + + .PARAMETER SkipPublisherCheck + Allows the installation of modules that have not been catalog signed. +#> +function Set-TargetResource { + <# + These suppressions are added because this repository have other Visual Studio Code workspace + settings than those in DscResource.Tests DSC test framework. + Only those suppression that contradict this repository guideline is added here. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-ForEachStatement', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-TryStatement', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-CatchClause', '')] + [CmdletBinding()] + param + ( + [Parameter()] + [ValidateSet('Present', 'Absent')] + [System.String] + $Ensure = 'Present', + + [Parameter(Mandatory = $true)] + [System.String] + $Name, + + [Parameter()] + [System.String] + $Repository = 'PSGallery', + + [Parameter()] + [ValidateSet('Trusted', 'Untrusted')] + [System.String] + $InstallationPolicy = 'Untrusted', + + [Parameter()] + [System.Boolean] + $Trusted = $false, + + [Parameter()] + [System.String] + $Version, + + [Parameter()] + [System.Boolean] + $NoClobber, + + [Parameter()] + [System.Boolean] + $SkipPublisherCheck + ) + + # Validate the repository argument + if ($PSBoundParameters.ContainsKey('Repository')) { + #Test-ParameterValue -Value $Repository -Type 'PackageSource' -Verbose + } + + if ($Ensure -ieq 'Present') { + # Version check + $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` + -ArgumentNames ('Version') + + # $null = Test-VersionParameter @extractedArguments + + $trusted = $null + $moduleFound = $null + + try { + $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` + -ArgumentNames ('Name', 'Repository', 'Version') + + Write-Verbose -Message ($localizedData.StartFindModule -f $Name) + Write-verbose ("Name is: $name") + Write-verbose ("Repository is: $repository") + Write-verbose ("Version is: $Version") + + $modules = Find-PSResource @extractedArguments -ErrorVariable ev -ErrorAction SilentlyContinue + + Write-verbose ("modules is: $modules") + $moduleFound = $modules[0] + } + catch { + $errorMessage = $script:localizedData.ModuleNotFoundInRepository -f $Name + New-InvalidOperationException -Message $errorMessage -ErrorRecord $_ + } + + + foreach ($m in $modules) { + # Check for the installation policy. + #$trusted = Get-InstallationPolicy -RepositoryName $m.Repository -ErrorAction SilentlyContinue -WarningAction SilentlyContinue + + # Stop the loop if found a trusted repository. + #if ($trusted) { + # $moduleFound = $m + # break; + #} + } + + try { + # The repository is trusted, so we install it. + #if ($trusted) { + # Write-Verbose -Message ($localizedData.StartInstallModule -f $Name, $moduleFound.Version.toString(), $moduleFound.Repository) + + # Extract the installation options. + ## $extractedSwitches = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters -ArgumentNames ('Force', 'AllowClobber', 'SkipPublisherCheck') + + ## $moduleFound | Install-Module @extractedSwitches 2>&1 | out-string | Write-Verbose + Install-PSResource -name $moduleFound.Name -Repository $moduleFound.Repository -version $moduleFound.Version -TrustRepository:$true -NoClobber:$NoClobber -Verbose #$SkipPublisherCheck, + + ##} + # The repository is untrusted but user's installation policy is trusted, so we install it with a warning. + ##elseif ($InstallationPolicy -ieq $true) { + ## Write-Warning -Message ($localizedData.InstallationPolicyWarning -f $Name, $modules[0].Repository, $InstallationPolicy) + + # Extract installation options (Force implied by InstallationPolicy). + ## $extractedSwitches = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters -ArgumentNames ('AllowClobber', 'SkipPublisherCheck') + + # If all the repositories are untrusted, we choose the first one. + ## $modules[0] | Install-Module @extractedSwitches -Force 2>&1 | out-string | Write-Verbose + ## } + # Both user and repository is untrusted + ##else { + ## $errorMessage = $script:localizedData.InstallationPolicyFailed -f $InstallationPolicy, 'Untrusted' + ## New-InvalidOperationException -Message $errorMessage + ##} + + Write-Verbose -Message ($localizedData.InstalledSuccess -f $Name) + } + catch { + $errorMessage = $script:localizedData.FailToInstall -f $Name + New-InvalidOperationException -Message $errorMessage -ErrorRecord $_ + } + } + # Ensure=Absent + else { + + $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` + -ArgumentNames ('Name', 'Repository', 'Version') + + # Get the module with the right version and repository properties. + $modules = Get-RightModule @extractedArguments + + if (-not $modules) { + $errorMessage = $script:localizedData.ModuleWithRightPropertyNotFound -f $Name + New-InvalidOperationException -Message $errorMessage + } + + foreach ($module in $modules) { + # Get the path where the module is installed. + $path = $module.ModuleBase + + Write-Verbose -Message ($localizedData.StartUnInstallModule -f $Name) + + try { + <# + There is no Uninstall-Module cmdlet for Windows PowerShell 4.0, + so we will remove the ModuleBase folder as an uninstall operation. + #> + Microsoft.PowerShell.Management\Remove-Item -Path $path -Force -Recurse + + Write-Verbose -Message ($localizedData.UnInstalledSuccess -f $module.Name) + } + catch { + $errorMessage = $script:localizedData.FailToUninstall -f $module.Name + New-InvalidOperationException -Message $errorMessage -ErrorRecord $_ + } + } # foreach + } # Ensure=Absent +} + +<# + .SYNOPSIS + This is a helper function. It returns the modules that meet the specified versions and the repository requirements. + + .PARAMETER Name + Specifies the name of the PowerShell module. + + .PARAMETER Version + Provides the version of the module you want to install or uninstall. + + .PARAMETER Repository + Specifies the name of the module source repository where the module can be found. +#> +function Get-RightModule { + <# + These suppressions are added because this repository have other Visual Studio Code workspace + settings than those in DscResource.Tests DSC test framework. + Only those suppression that contradict this repository guideline is added here. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-ForEachStatement', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $Name, + + [Parameter()] + [System.String] + $Version, + + [Parameter()] + [System.String] + $Repository + ) + + Write-Verbose -Message ($localizedData.StartGetModule -f $($Name)) + + $modules = Microsoft.PowerShell.Core\Get-Module -Name $Name -ListAvailable -ErrorAction SilentlyContinue -WarningAction SilentlyContinue + + if (-not $modules) { + return $null + } + + <# + As Get-Module does not take RequiredVersion, MinimumVersion, MaximumVersion, or Repository, + below we need to check whether the modules are containing the right version and repository + location. + #> + + $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` + -ArgumentNames ('Version') + $returnVal = @() + + foreach ($m in $modules) { + $versionMatch = $false + $installedVersion = $m.Version + + # Case 1 - a user provides none of RequiredVersion, MinimumVersion, MaximumVersion + if ($extractedArguments.Count -eq 0) { + $versionMatch = $true + } + + ########### COME BACK HERE + # Case 2 - a user provides RequiredVersion + elseif ($extractedArguments.ContainsKey('Version')) { + # Check if it matches with the installed version + $versionMatch = ($installedVersion -eq [System.Version] $RequiredVersion) + } + <# + else { + + # Case 3 - a user provides MinimumVersion + if ($extractedArguments.ContainsKey('MinimumVersion')) { + $versionMatch = ($installedVersion -ge [System.Version] $extractedArguments['MinimumVersion']) + } + + # Case 4 - a user provides MaximumVersion + if ($extractedArguments.ContainsKey('MaximumVersion')) { + $isLessThanMax = ($installedVersion -le [System.Version] $extractedArguments['MaximumVersion']) + + if ($extractedArguments.ContainsKey('MinimumVersion')) { + $versionMatch = $versionMatch -and $isLessThanMax + } + else { + $versionMatch = $isLessThanMax + } + } + + # Case 5 - Both MinimumVersion and MaximumVersion are provided. It's covered by the above. + # Do not return $false yet to allow the foreach to continue + if (-not $versionMatch) { + Write-Verbose -Message ($localizedData.VersionMismatch -f $Name, $installedVersion) + $versionMatch = $false + } + } + #> + + # Case 6 - Version matches but need to check if the module is from the right repository. + if ($versionMatch) { + # A user does not provide Repository, we are good + if (-not $PSBoundParameters.ContainsKey('Repository')) { + Write-Verbose -Message ($localizedData.ModuleFound -f "$Name $installedVersion") + $returnVal += $m + } + else { + # Check if the Repository matches + $sourceName = Get-ModuleRepositoryName -Module $m + + if ($Repository -ieq $sourceName) { + Write-Verbose -Message ($localizedData.ModuleFound -f "$Name $installedVersion") + $returnVal += $m + } + else { + Write-Verbose -Message ($localizedData.RepositoryMismatch -f $($Name), $($sourceName)) + } + } + } + } # foreach + + return $returnVal +} + +<# + .SYNOPSIS + This is a helper function that returns the module's repository name. + + .PARAMETER Module + Specifies the name of the PowerShell module. +#> +function Get-ModuleRepositoryName { + <# + These suppressions are added because this repository have other Visual Studio Code workspace + settings than those in DscResource.Tests DSC test framework. + Only those suppression that contradict this repository guideline is added here. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.Object] + $Module + ) + + <# + RepositorySourceLocation property is supported in PS V5 only. To work with the earlier + PowerShell version, we need to do a different way. PSGetModuleInfo.xml exists for any + PowerShell modules downloaded through PSModule provider. + #> + $psGetModuleInfoFileName = 'PSGetModuleInfo.xml' + $psGetModuleInfoPath = Microsoft.PowerShell.Management\Join-Path -Path $Module.ModuleBase -ChildPath $psGetModuleInfoFileName + + Write-Verbose -Message ($localizedData.FoundModulePath -f $psGetModuleInfoPath) + + if (Microsoft.PowerShell.Management\Test-path -Path $psGetModuleInfoPath) { + $psGetModuleInfo = Microsoft.PowerShell.Utility\Import-Clixml -Path $psGetModuleInfoPath + + return $psGetModuleInfo.Repository + } +} diff --git a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl new file mode 100644 index 0000000..db8de1e --- /dev/null +++ b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl @@ -0,0 +1,21 @@ +#pragma namespace("\\\\.\\root\\default") +instance of __namespace{ name="MS_409";}; +#pragma namespace("\\\\.\\root\\default\\MS_409") + +[AMENDMENT, LOCALE("MS_409")] +class MSFT_PSModule : OMI_BaseResource +{ + [Key,Description("Name of the module\n") : Amended] String Name; + [Description("Whether the module is to be installed or uninstalled.\nPresent {default} \nAbsent \n") : Amended] String Ensure; + [Description("The name of the module source where the module can be found.\n") : Amended] String Repository; + [Description("Whether the package is trusted or untrusted.\nTrusted {default} \nUntrusted \n") : Amended] String InstallationPolicy; + [Description("The version of the module.\n") : Amended] String Version; + [Description("Does not allow installation when existing cmdlets of the same name exist.\n" : Amended] Boolean NoClobber; + [Description("Allows installation when module is not signed.\n" : Amended] Boolean SkipPublisherCheck; + [Description("The brief description of the module.\n") : Amended] string Description; + [Description("The version of the module that is installed.\n") : Amended] String InstalledVersion; + [Description("The identifier of the module.\n") : Amended] String Guid; + [Description("The base location where the module is installed.\n") : Amended] String ModuleBase; + [Description("The type of the module.\n") : Amended] String ModuleType; + [Description("The author of the module.\n") : Amended] String Author; +}; diff --git a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof new file mode 100644 index 0000000..4001858 --- /dev/null +++ b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof @@ -0,0 +1,19 @@ + +[ClassVersion("1.0.0.0"),FriendlyName("PSModule")] +class MSFT_PSModule : OMI_BaseResource +{ + [Key] String Name; + [Write,ValueMap{"Present", "Absent"},Values{"Present", "Absent"}] String Ensure; + [Write] String Repository; + [Write,ValueMap{"Trusted", "Untrusted"},Values{"Trusted", "Untrusted"}] String InstallationPolicy; + [Write] Boolean Trusted; + [Write] String Version; + [Write] Boolean NoClobber; + [Write] Boolean SkipPublisherCheck; + [Read] string Description; + [Read] String InstalledVersion; + [Read] String Guid; + [Read] String ModuleBase; + [Read] String ModuleType; + [Read] String Author; +}; diff --git a/src/code/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 b/src/code/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 new file mode 100644 index 0000000..e1a37ac --- /dev/null +++ b/src/code/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 @@ -0,0 +1,35 @@ +# +# Copyright (c) Microsoft Corporation. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# culture = "en-US" +ConvertFrom-StringData -StringData @' + FailToUninstall = Failed to uninstall the module '{0}'. + FailToInstall = Failed to install the module '{0}'. + InDesiredState = Resource '{0}' is in the desired state. + NotInDesiredState = Resource '{0}' is not in the desired state. + ModuleFound = Module '{0}' is found on the node. + ModuleNotFound = Module '{0}' is not found on the node. + ModuleWithRightPropertyNotFound = Module '{0}' with the right version or other properties not found in the node. + ModuleNotFoundInRepository = Module '{0}' with the right version or other properties not found in the repository. + StartGetModule = Begin invoking Get-Module '{0}'. + StartFindModule = Begin invoking Find-PSResource '{0}'. + StartInstallModule = Begin invoking Install-PSResource '{0}' version '{1}' from '{2}' repository. + StartUnInstallModule = Begin invoking Remove-Item to remove the module '{0}' from the file system. + InstalledSuccess = Successfully installed the module '{0}' + UnInstalledSuccess = Successfully uninstalled the module '{0}' + VersionMismatch = The installed module '{0}' has the version: '{1}' + RepositoryMismatch = The installed module '{0}' is from the '{1}' repository. + FoundModulePath = Found the module path: '{0}'. + InstallationPolicyWarning = The module '{0}' was installed from the untrusted repository' {1}'. The InstallationPolicy is set to '{2}' to override the repository installation policy. If you trust the repository, set the repository installation policy to 'Trusted', that will also remove this warning. + InstallationPolicyFailed = The current installation policy do not allow installation from this repository. Your current installation policy is '{0}' and the repository installation policy is '{1}'. If you trust the repository, either change the repository installation policy, or set the parameter InstallationPolicy to 'Trusted' to override the repository installation policy. + GetTargetResourceMessage = Getting the current state of the module '{0}'. + TestTargetResourceMessage = Determining if the module '{0}' is in the desired state. +'@ diff --git a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 new file mode 100644 index 0000000..30c0dfe --- /dev/null +++ b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 @@ -0,0 +1,273 @@ +$resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent + +# Import localization helper functions. +$helperName = 'PowerShellGet.LocalizationHelper' +$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" +Import-Module -Name $dscResourcesFolderFilePath + +$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_PSRepository' -ScriptRoot $PSScriptRoot + +# Import resource helper functions. +$helperName = 'PowerShellGet.ResourceHelper' +$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" +Import-Module -Name $dscResourcesFolderFilePath + +<# + .SYNOPSIS + Returns the current state of the repository. + + .PARAMETER Name + Specifies the name of the repository to manage. +#> +function Get-TargetResource { + <# + These suppressions are added because this repository have other Visual Studio Code workspace + settings than those in DscResource.Tests DSC test framework. + Only those suppression that contradict this repository guideline is added here. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [Parameter(Mandatory = $true)] + [System.String] + $Name + ) + + $returnValue = @{ + Ensure = 'Absent' + Name = $Name + URL = $null + Priority = $null + #InstallationPolicy = $null + #Trusted = $false + Registered = $false + } + + Write-Verbose -Message ($localizedData.GetTargetResourceMessage -f $Name) + + $repository = Get-PSResourceRepository -Name $Name -ErrorAction 'SilentlyContinue' + + if ($repository) { + $returnValue.Ensure = 'Present' + $returnValue.SourceLocation = $repository.SourceLocation + $returnValue.ScriptSourceLocation = $repository.ScriptSourceLocation + $returnValue.PublishLocation = $repository.PublishLocation + $returnValue.ScriptPublishLocation = $repository.ScriptPublishLocation + $returnValue.InstallationPolicy = $repository.InstallationPolicy + $returnValue.PackageManagementProvider = $repository.PackageManagementProvider + $returnValue.Trusted = $repository.Trusted + $returnValue.Registered = $repository.Registered + } + else { + Write-Verbose -Message ($localizedData.RepositoryNotFound -f $Name) + } + + return $returnValue +} + +<# + .SYNOPSIS + Determines if the repository is in the desired state. + + .PARAMETER Ensure + If the repository should be present or absent on the server + being configured. Default values is 'Present'. + + .PARAMETER Name + Specifies the name of the repository to manage. + + .PARAMETER SourceLocation + Specifies the URI for discovering and installing modules from + this repository. A URI can be a NuGet server feed, HTTP, HTTPS, + FTP or file location. + + .PARAMETER ScriptSourceLocation + Specifies the URI for the script source location. + + .PARAMETER PublishLocation + Specifies the URI of the publish location. For example, for + NuGet-based repositories, the publish location is similar + to http://someNuGetUrl.com/api/v2/Packages. + + .PARAMETER ScriptPublishLocation + Specifies the URI for the script publish location. + + .PARAMETER InstallationPolicy + Specifies the installation policy. Valid values are 'Trusted' + or 'Untrusted'. The default value is 'Untrusted'. + + .PARAMETER PackageManagementProvider + Specifies a OneGet package provider. Default value is 'NuGet'. +#> +function Test-TargetResource { + <# + These suppressions are added because this repository have other Visual Studio Code workspace + settings than those in DscResource.Tests DSC test framework. + Only those suppression that contradict this repository guideline is added here. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] + [CmdletBinding()] + [OutputType([System.Boolean])] + param + ( + [Parameter()] + [ValidateSet('Present', 'Absent')] + [System.String] + $Ensure = 'Present', + + [Parameter(Mandatory = $true)] + [System.String] + $Name, + + [Parameter()] + [System.String] + $URL, + + [Parameter()] + [System.String] + $Priority, + + [Parameter()] + [ValidateSet('Trusted', 'Untrusted')] + [System.String] + $InstallationPolicy = 'Untrusted' + ) + + Write-Verbose -Message ($localizedData.TestTargetResourceMessage -f $Name) + + $returnValue = $false + + $getTargetResourceResult = Get-TargetResource -Name $Name + + if ($Ensure -eq $getTargetResourceResult.Ensure) { + if ($getTargetResourceResult.Ensure -eq 'Present' ) { + $returnValue = Test-DscParameterState ` + -CurrentValues $getTargetResourceResult ` + -DesiredValues $PSBoundParameters ` + -ValuesToCheck @( + 'URL' + 'Priority' + #'InstallationPolicy' + ) + } + else { + $returnValue = $true + } + } + + if ($returnValue) { + Write-Verbose -Message ($localizedData.InDesiredState -f $Name) + } + else { + Write-Verbose -Message ($localizedData.NotInDesiredState -f $Name) + } + + return $returnValue +} + +<# + .SYNOPSIS + Creates, removes or updates the repository. + + .PARAMETER Ensure + If the repository should be present or absent on the server + being configured. Default values is 'Present'. + + .PARAMETER Name + Specifies the name of the repository to manage. + + .PARAMETER SourceLocation + Specifies the URI for discovering and installing modules from + this repository. A URI can be a NuGet server feed, HTTP, HTTPS, + FTP or file location. + + .PARAMETER ScriptSourceLocation + Specifies the URI for the script source location. + + .PARAMETER PublishLocation + Specifies the URI of the publish location. For example, for + NuGet-based repositories, the publish location is similar + to http://someNuGetUrl.com/api/v2/Packages. + + .PARAMETER ScriptPublishLocation + Specifies the URI for the script publish location. + + .PARAMETER InstallationPolicy + Specifies the installation policy. Valid values are 'Trusted' + or 'Untrusted'. The default value is 'Untrusted'. + + .PARAMETER PackageManagementProvider + Specifies a OneGet package provider. Default value is 'NuGet'. +#> +function Set-TargetResource { + <# + These suppressions are added because this repository have other Visual Studio Code workspace + settings than those in DscResource.Tests DSC test framework. + Only those suppression that contradict this repository guideline is added here. + #> + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] + [CmdletBinding()] + param + ( + [Parameter()] + [ValidateSet('Present', 'Absent')] + [System.String] + $Ensure = 'Present', + + [Parameter(Mandatory = $true)] + [System.String] + $Name, + + [Parameter()] + [System.String] + $URL, + + [Parameter()] + [ValidateSet('Trusted', 'Untrusted')] + [System.String] + $InstallationPolicy = 'Untrusted' + ) + + $getTargetResourceResult = Get-TargetResource -Name $Name + + Write-Verbose("Name: $Name") + Write-Verbose("URL: $URL") + # Determine if the repository should be present or absent. + if ($Ensure -eq 'Present') { + $repositoryParameters = New-SplatParameterHashTable ` + -FunctionBoundParameters $PSBoundParameters ` + -ArgumentNames @( + 'Name' + 'URL' + #'InstallationPolicy' + ) + + # Determine if the repository is already present. + if ($getTargetResourceResult.Ensure -eq 'Present') { + Write-Verbose -Message ($localizedData.RepositoryExist -f $Name) + + # Repository exist, update the properties. + Set-PSResourceRepository @repositoryParameters -ErrorAction 'Stop' + } + else { + Write-Verbose -Message ($localizedData.RepositoryDoesNotExist -f $Name) + + # Repository did not exist, create the repository. + Register-PSResourceRepository @repositoryParameters -ErrorAction 'Stop' + } + } + else { + if ($getTargetResourceResult.Ensure -eq 'Present') { + Write-Verbose -Message ($localizedData.RemoveExistingRepository -f $Name) + + # Repository did exist, remove the repository. + Unregister-PSResourceRepository -Name $Name -ErrorAction 'Stop' + } + } +} diff --git a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl new file mode 100644 index 0000000..20d1871 --- /dev/null +++ b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl @@ -0,0 +1,15 @@ +#pragma namespace("\\\\.\\root\\default") +instance of __namespace{ name="MS_409";}; +#pragma namespace("\\\\.\\root\\default\\MS_409") + +[AMENDMENT, LOCALE("MS_409")] +class MSFT_PSModule : OMI_BaseResource +{ + [Key, Description("Specifies the name of the repository to manage.") : Amended] String Name; + [Description("If the repository should be present or absent on the server being configured. Default values is 'Present'.") : Amended] String Ensure; + [Description("Specifies the URI for discovering and installing modules from this repository. A URI can be a NuGet server feed, HTTP, HTTPS, FTP or file location.") : Amended] String URL; + [Description("Specifies the priority for the repository.") : Amended] String Priority; + [Description("Specifies the installation policy. Valid values are 'Trusted' or 'Untrusted'. The default value is 'Untrusted'.") : Amended] String InstallationPolicy; + [Description("Specifies if the repository is trusted.") : Amended] Boolean Trusted; + [Description("Specifies if the repository is registered.") : Amended] Boolean Registered; +}; diff --git a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof new file mode 100644 index 0000000..46dcb7f --- /dev/null +++ b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof @@ -0,0 +1,11 @@ +[ClassVersion("1.0.0.0"),FriendlyName("PSRepository")] +class MSFT_PSRepository : OMI_BaseResource +{ + [Key] String Name; + [Write, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; + [Write] String URL; + [Write] String Priority; + [Write, ValueMap{"Trusted","Untrusted"}, Values{"Trusted","Untrusted"}] String InstallationPolicy; + [Read] Boolean Trusted; + [Read] Boolean Registered; +}; diff --git a/src/code/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 b/src/code/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 new file mode 100644 index 0000000..81c7c75 --- /dev/null +++ b/src/code/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 @@ -0,0 +1,22 @@ +# +# Copyright (c) Microsoft Corporation. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# culture = "en-US" +ConvertFrom-StringData -StringData @' + GetTargetResourceMessage = Return the current state of the repository '{0}'. + RepositoryNotFound = The repository '{0}' was not found. + TestTargetResourceMessage = Determining if the repository '{0}' is in the desired state. + InDesiredState = Repository '{0}' is in the desired state. + NotInDesiredState = Repository '{0}' is not in the desired state. + RepositoryExist = Updating the properties of the repository '{0}'. + RepositoryDoesNotExist = Creating the repository '{0}'. + RemoveExistingRepository = Removing the repository '{0}'. +'@ diff --git a/src/code/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 b/src/code/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 new file mode 100644 index 0000000..9f6b612 --- /dev/null +++ b/src/code/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 @@ -0,0 +1,254 @@ +<# + .SYNOPSIS + Creates and throws an invalid argument exception. + + .PARAMETER Message + The message explaining why this error is being thrown. + + .PARAMETER ArgumentName + The name of the invalid argument that is causing this error to be thrown. +#> +function New-InvalidArgumentException { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $Message, + + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $ArgumentName + ) + + $argumentException = New-Object -TypeName 'ArgumentException' ` + -ArgumentList @($Message, $ArgumentName) + + $newObjectParameters = @{ + TypeName = 'System.Management.Automation.ErrorRecord' + ArgumentList = @($argumentException, $ArgumentName, 'InvalidArgument', $null) + } + + $errorRecord = New-Object @newObjectParameters + + throw $errorRecord +} + +<# + .SYNOPSIS + Creates and throws an invalid operation exception. + + .PARAMETER Message + The message explaining why this error is being thrown. + + .PARAMETER ErrorRecord + The error record containing the exception that is causing this terminating error. +#> +function New-InvalidOperationException { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $Message, + + [Parameter()] + [ValidateNotNull()] + [System.Management.Automation.ErrorRecord] + $ErrorRecord + ) + + if ($null -eq $ErrorRecord) { + $invalidOperationException = New-Object -TypeName 'InvalidOperationException' ` + -ArgumentList @($Message) + } + else { + $invalidOperationException = New-Object -TypeName 'InvalidOperationException' ` + -ArgumentList @($Message, $ErrorRecord.Exception) + } + + $newObjectParameters = @{ + TypeName = 'System.Management.Automation.ErrorRecord' + ArgumentList = @( + $invalidOperationException.ToString(), + 'MachineStateIncorrect', + 'InvalidOperation', + $null + ) + } + + $errorRecordToThrow = New-Object @newObjectParameters + + throw $errorRecordToThrow +} + +<# + .SYNOPSIS + Creates and throws an object not found exception. + + .PARAMETER Message + The message explaining why this error is being thrown. + + .PARAMETER ErrorRecord + The error record containing the exception that is causing this terminating error. +#> +function New-ObjectNotFoundException { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $Message, + + [Parameter()] + [ValidateNotNull()] + [System.Management.Automation.ErrorRecord] + $ErrorRecord + ) + + if ($null -eq $ErrorRecord) { + $exception = New-Object -TypeName 'System.Exception' ` + -ArgumentList @($Message) + } + else { + $exception = New-Object -TypeName 'System.Exception' ` + -ArgumentList @($Message, $ErrorRecord.Exception) + } + + $newObjectParameters = @{ + TypeName = 'System.Management.Automation.ErrorRecord' + ArgumentList = @( + $exception.ToString(), + 'MachineStateIncorrect', + 'ObjectNotFound', + $null + ) + } + + $errorRecordToThrow = New-Object @newObjectParameters + + throw $errorRecordToThrow +} + +<# + .SYNOPSIS + Creates and throws an invalid result exception. + + .PARAMETER Message + The message explaining why this error is being thrown. + + .PARAMETER ErrorRecord + The error record containing the exception that is causing this terminating error. +#> +function New-InvalidResultException { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $Message, + + [Parameter()] + [ValidateNotNull()] + [System.Management.Automation.ErrorRecord] + $ErrorRecord + ) + + if ($null -eq $ErrorRecord) { + $exception = New-Object -TypeName 'System.Exception' ` + -ArgumentList @($Message) + } + else { + $exception = New-Object -TypeName 'System.Exception' ` + -ArgumentList @($Message, $ErrorRecord.Exception) + } + + $newObjectParameters = @{ + TypeName = 'System.Management.Automation.ErrorRecord' + ArgumentList = @( + $exception.ToString(), + 'MachineStateIncorrect', + 'InvalidResult', + $null + ) + } + + $errorRecordToThrow = New-Object @newObjectParameters + + throw $errorRecordToThrow +} + +<# + .SYNOPSIS + Retrieves the localized string data based on the machine's culture. + Falls back to en-US strings if the machine's culture is not supported. + + .PARAMETER ResourceName + The name of the resource as it appears before '.strings.psd1' of the localized string file. + For example: + For WindowsOptionalFeature: MSFT_WindowsOptionalFeature + For Service: MSFT_ServiceResource + For Registry: MSFT_RegistryResource + For Helper: SqlServerDscHelper + + .PARAMETER ScriptRoot + Optional. The root path where to expect to find the culture folder. This is only needed + for localization in helper modules. This should not normally be used for resources. +#> +function Get-LocalizedData { + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $ResourceName, + + [Parameter()] + [ValidateNotNullOrEmpty()] + [System.String] + $ScriptRoot + ) + + if ( -not $ScriptRoot ) { + $resourceDirectory = Join-Path -Path $PSScriptRoot -ChildPath $ResourceName + $localizedStringFileLocation = Join-Path -Path $resourceDirectory -ChildPath $PSUICulture + } + else { + $localizedStringFileLocation = Join-Path -Path $ScriptRoot -ChildPath $PSUICulture + } + + if (-not (Test-Path -Path $localizedStringFileLocation)) { + # Fallback to en-US + if ( -not $ScriptRoot ) { + $localizedStringFileLocation = Join-Path -Path $resourceDirectory -ChildPath 'en-US' + } + else { + $localizedStringFileLocation = Join-Path -Path $ScriptRoot -ChildPath 'en-US' + } + } + + Import-LocalizedData ` + -BindingVariable 'localizedData' ` + -FileName "$ResourceName.strings.psd1" ` + -BaseDirectory $localizedStringFileLocation + + return $localizedData +} + +Export-ModuleMember -Function @( + 'New-InvalidArgumentException', + 'New-InvalidOperationException', + 'New-ObjectNotFoundException', + 'New-InvalidResultException', + 'Get-LocalizedData' +) diff --git a/src/code/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 b/src/code/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 new file mode 100644 index 0000000..2a01934 --- /dev/null +++ b/src/code/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 @@ -0,0 +1,368 @@ +# +# Copyright (c) Microsoft Corporation. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# + +<# + Helper functions for PowerShellGet DSC Resources. +#> + +# Import localization helper functions. +$helperName = 'PowerShellGet.LocalizationHelper' +$resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent +$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" +Import-Module -Name $dscResourcesFolderFilePath + +# Import Localization Strings +$script:localizedData = Get-LocalizedData -ResourceName 'PowerShellGet.ResourceHelper' -ScriptRoot $PSScriptRoot + +<# + .SYNOPSIS + This is a helper function that extract the parameters from a given table. + + .PARAMETER FunctionBoundParameters + Specifies the hash table containing a set of parameters to be extracted. + + .PARAMETER ArgumentNames + Specifies a list of arguments you want to extract. +#> +function New-SplatParameterHashTable { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] + [CmdletBinding()] + [OutputType([System.Collections.Hashtable])] + param + ( + [Parameter(Mandatory = $true)] + [System.Collections.Hashtable] + $FunctionBoundParameters, + + [Parameter(Mandatory = $true)] + [System.String[]] + $ArgumentNames + ) + + Write-Verbose -Message ($script:localizedData.CallingFunction -f $($MyInvocation.MyCommand)) + + $returnValue = @{} + + foreach ($arg in $ArgumentNames) { + if ($FunctionBoundParameters.ContainsKey($arg)) { + # Found an argument we are looking for, so we add it to return collection. + $returnValue.Add($arg, $FunctionBoundParameters[$arg]) + } + } + + return $returnValue +} + +<# + .SYNOPSIS + This is a helper function that validate that a value is correct and used correctly. + + .PARAMETER Value + Specifies the value to be validated. + + .PARAMETER Type + Specifies the type of argument. + + .PARAMETER Type + Specifies the name of the provider. + + .OUTPUTS + None. Throws an error if the test fails. +#> +function Test-ParameterValue { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')] + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $Value, + + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $Type, + + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] + $ProviderName + ) + + Write-Verbose -Message ($script:localizedData.CallingFunction -f $($MyInvocation.MyCommand)) + + switch ($Type) { + 'SourceUri' { + # Checks whether given URI represents specific scheme + # Most common schemes: file, http, https, ftp + $scheme = @('http', 'https', 'file', 'ftp') + + $newUri = $Value -as [System.URI] + $returnValue = ($newUri -and $newUri.AbsoluteURI -and ($scheme -icontains $newUri.Scheme)) + + if ($returnValue -eq $false) { + $errorMessage = $script:localizedData.InValidUri -f $Value + New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage + } + } + + 'DestinationPath' { + $returnValue = Test-Path -Path $Value + + if ($returnValue -eq $false) { + $errorMessage = $script:localizedData.PathDoesNotExist -f $Value + New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage + } + } + + <# + 'PackageSource' { + # Value can be either the package source Name or source Uri. + # Check if the source is a Uri. + $uri = $Value -as [System.URI] + + if ($uri -and $uri.AbsoluteURI) { + # Check if it's a valid Uri. + Test-ParameterValue -Value $Value -Type 'SourceUri' -ProviderName $ProviderName + } + else { + # Check if it's a registered package source name. + # $source = PackageManagement\Get-PackageSource -Name $Value -ProviderName $ProviderName -ErrorVariable ev + + if ((-not $source) -or $ev) { + # We do not need to throw error here as Get-PackageSource does already. + Write-Verbose -Message ($script:localizedData.SourceNotFound -f $source) + } + } + } #> + + default { + $errorMessage = $script:localizedData.UnexpectedArgument -f $Type + New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage + } + } +} + +<# + .SYNOPSIS + This is a helper function that does the version validation. + + .PARAMETER Version + Provides the version. +#> +function Test-VersionParameter { + [CmdletBinding()] + param + ( + [Parameter()] + [System.String] + $Version + ) + + Write-Verbose -Message ($localizedData.CallingFunction -f $($MyInvocation.MyCommand)) + + $isValid = $false + + # Case 1: No further check required if a user provides either none or one of these: minimumVersion, maximumVersion, and requiredVersion. + if ($PSBoundParameters.Count -le 1) { + return $true + } + + ########## COME BACK HERE + # Case 2: #If no RequiredVersion is provided. + #if (-not $PSBoundParameters.ContainsKey('Version')) { + # If no RequiredVersion, both MinimumVersion and MaximumVersion are provided. Otherwise fall into the Case #1. + #$isValid = $PSBoundParameters['MinimumVersion'] -le $PSBoundParameters['MaximumVersion'] + #} + $isValid = $true + # Case 3: RequiredVersion is provided. + # In this case MinimumVersion and/or MaximumVersion also are provided. Otherwise fall in to Case #1. + # This is an invalid case. When RequiredVersion is provided, others are not allowed. so $isValid is false, which is already set in the init. + + if ($isValid -eq $false) { + $errorMessage = $script:localizedData.VersionError + New-InvalidArgumentException ` + -ArgumentName 'RequiredVersion, MinimumVersion or MaximumVersion' ` + -Message $errorMessage + } +} + +<# + .SYNOPSIS + This is a helper function that retrieves the InstallationPolicy from the given repository. + + .PARAMETER RepositoryName + Provides the repository Name. +#> +function Get-InstallationPolicy { + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [ValidateNotNullOrEmpty()] + [System.String] $RepositoryName + ) + + Write-Verbose -Message ($LocalizedData.CallingFunction -f $($MyInvocation.MyCommand)) + + $repositoryObject = Get-PSResourceRepository -Name $RepositoryName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue + + if ($repositoryObject) { + return $repositoryObject.IsTrusted + } +} + +<# + .SYNOPSIS + This method is used to compare current and desired values for any DSC resource. + + .PARAMETER CurrentValues + This is hash table of the current values that are applied to the resource. + + .PARAMETER DesiredValues + This is a PSBoundParametersDictionary of the desired values for the resource. + + .PARAMETER ValuesToCheck + This is a list of which properties in the desired values list should be checked. + If this is empty then all values in DesiredValues are checked. +#> +function Test-DscParameterState { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')] + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '')] + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $true)] + [System.Collections.Hashtable] + $CurrentValues, + + [Parameter(Mandatory = $true)] + [System.Object] + $DesiredValues, + + [Parameter()] + [System.Array] + $ValuesToCheck + ) + + $returnValue = $true + + if (($DesiredValues.GetType().Name -ne 'HashTable') ` + -and ($DesiredValues.GetType().Name -ne 'CimInstance') ` + -and ($DesiredValues.GetType().Name -ne 'PSBoundParametersDictionary')) { + $errorMessage = $script:localizedData.PropertyTypeInvalidForDesiredValues -f $($DesiredValues.GetType().Name) + New-InvalidArgumentException -ArgumentName 'DesiredValues' -Message $errorMessage + } + + if (($DesiredValues.GetType().Name -eq 'CimInstance') -and ($null -eq $ValuesToCheck)) { + $errorMessage = $script:localizedData.PropertyTypeInvalidForValuesToCheck + New-InvalidArgumentException -ArgumentName 'ValuesToCheck' -Message $errorMessage + } + + if (($null -eq $ValuesToCheck) -or ($ValuesToCheck.Count -lt 1)) { + $keyList = $DesiredValues.Keys + } + else { + $keyList = $ValuesToCheck + } + + $keyList | ForEach-Object -Process { + if (($_ -ne 'Verbose')) { + if (($CurrentValues.ContainsKey($_) -eq $false) ` + -or ($CurrentValues.$_ -ne $DesiredValues.$_) ` + -or (($DesiredValues.GetType().Name -ne 'CimInstance' -and $DesiredValues.ContainsKey($_) -eq $true) -and ($null -ne $DesiredValues.$_ -and $DesiredValues.$_.GetType().IsArray))) { + if ($DesiredValues.GetType().Name -eq 'HashTable' -or ` + $DesiredValues.GetType().Name -eq 'PSBoundParametersDictionary') { + $checkDesiredValue = $DesiredValues.ContainsKey($_) + } + else { + # If DesiredValue is a CimInstance. + $checkDesiredValue = $false + if (([System.Boolean]($DesiredValues.PSObject.Properties.Name -contains $_)) -eq $true) { + if ($null -ne $DesiredValues.$_) { + $checkDesiredValue = $true + } + } + } + + if ($checkDesiredValue) { + $desiredType = $DesiredValues.$_.GetType() + $fieldName = $_ + if ($desiredType.IsArray -eq $true) { + if (($CurrentValues.ContainsKey($fieldName) -eq $false) ` + -or ($null -eq $CurrentValues.$fieldName)) { + Write-Verbose -Message ($script:localizedData.PropertyValidationError -f $fieldName) -Verbose + + $returnValue = $false + } + else { + $arrayCompare = Compare-Object -ReferenceObject $CurrentValues.$fieldName ` + -DifferenceObject $DesiredValues.$fieldName + if ($null -ne $arrayCompare) { + Write-Verbose -Message ($script:localizedData.PropertiesDoesNotMatch -f $fieldName) -Verbose + + $arrayCompare | ForEach-Object -Process { + Write-Verbose -Message ($script:localizedData.PropertyThatDoesNotMatch -f $_.InputObject, $_.SideIndicator) -Verbose + } + + $returnValue = $false + } + } + } + else { + switch ($desiredType.Name) { + 'String' { + if (-not [System.String]::IsNullOrEmpty($CurrentValues.$fieldName) -or ` + -not [System.String]::IsNullOrEmpty($DesiredValues.$fieldName)) { + Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` + -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose + + $returnValue = $false + } + } + + 'Int32' { + if (-not ($DesiredValues.$fieldName -eq 0) -or ` + -not ($null -eq $CurrentValues.$fieldName)) { + Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` + -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose + + $returnValue = $false + } + } + + { $_ -eq 'Int16' -or $_ -eq 'UInt16'} { + if (-not ($DesiredValues.$fieldName -eq 0) -or ` + -not ($null -eq $CurrentValues.$fieldName)) { + Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` + -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose + + $returnValue = $false + } + } + + default { + Write-Warning -Message ($script:localizedData.UnableToCompareProperty ` + -f $fieldName, $desiredType.Name) + + $returnValue = $false + } + } + } + } + } + } + } + + return $returnValue +} diff --git a/src/code/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 b/src/code/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 new file mode 100644 index 0000000..8e3522f --- /dev/null +++ b/src/code/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 @@ -0,0 +1,29 @@ +# +# Copyright (c) Microsoft Corporation. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# +# culture = "en-US" +ConvertFrom-StringData -StringData @' +###PSLOC + InValidUri = InValid Uri: '{0}'. A sample valid uri: https://www.powershellgallery.com/api/v2/. + PathDoesNotExist = Path: '{0}' does not exist. + VersionError = MinimumVersion should be less than the MaximumVersion. The MinimumVersion or MaximumVersion cannot be used with the RequiredVersion in the same command. + UnexpectedArgument = Unexpected argument type: '{0}'. + SourceNotFound = Source '{0}' not found. Please make sure you register it. + CallingFunction = Calling function '{0}'. + PropertyTypeInvalidForDesiredValues = Property 'DesiredValues' must be either a [System.Collections.Hashtable], [CimInstance] or [PSBoundParametersDictionary]. The type detected was {0}. + PropertyTypeInvalidForValuesToCheck = If 'DesiredValues' is a CimInstance, then property 'ValuesToCheck' must contain a value. + PropertyValidationError = Expected to find an array value for property {0} in the current values, but it was either not present or was null. This has caused the test method to return false. + PropertiesDoesNotMatch = Found an array for property {0} in the current values, but this array does not match the desired state. Details of the changes are below. + PropertyThatDoesNotMatch = {0} - {1} + ValueOfTypeDoesNotMatch = {0} value for property {1} does not match. Current state is '{2}' and desired state is '{3}'. + UnableToCompareProperty = Unable to compare property {0} as the type {1} is not handled by the Test-SQLDSCParameterState cmdlet. +###PSLOC +'@ diff --git a/Tests/Integration/MSFT_PSModule.Integration.Tests.ps1 b/test/Integration/MSFT_PSModule.Integration.Tests.ps1 similarity index 100% rename from Tests/Integration/MSFT_PSModule.Integration.Tests.ps1 rename to test/Integration/MSFT_PSModule.Integration.Tests.ps1 diff --git a/Tests/Integration/MSFT_PSModule.config.ps1 b/test/Integration/MSFT_PSModule.config.ps1 similarity index 100% rename from Tests/Integration/MSFT_PSModule.config.ps1 rename to test/Integration/MSFT_PSModule.config.ps1 diff --git a/Tests/Integration/MSFT_PSRepository.Integration.Tests.ps1 b/test/Integration/MSFT_PSRepository.Integration.Tests.ps1 similarity index 100% rename from Tests/Integration/MSFT_PSRepository.Integration.Tests.ps1 rename to test/Integration/MSFT_PSRepository.Integration.Tests.ps1 diff --git a/Tests/Integration/MSFT_PSRepository.config.ps1 b/test/Integration/MSFT_PSRepository.config.ps1 similarity index 100% rename from Tests/Integration/MSFT_PSRepository.config.ps1 rename to test/Integration/MSFT_PSRepository.config.ps1 diff --git a/Tests/Unit/MSFT_PSModule.Tests.ps1 b/test/Unit/MSFT_PSModule.Tests.ps1 similarity index 100% rename from Tests/Unit/MSFT_PSModule.Tests.ps1 rename to test/Unit/MSFT_PSModule.Tests.ps1 diff --git a/Tests/Unit/MSFT_PSRepository.Tests.ps1 b/test/Unit/MSFT_PSRepository.Tests.ps1 similarity index 100% rename from Tests/Unit/MSFT_PSRepository.Tests.ps1 rename to test/Unit/MSFT_PSRepository.Tests.ps1 diff --git a/Tests/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 b/test/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 similarity index 100% rename from Tests/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 rename to test/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 diff --git a/Tests/Unit/PowerShellGet.ResourceHelper.Tests.ps1 b/test/Unit/PowerShellGet.ResourceHelper.Tests.ps1 similarity index 100% rename from Tests/Unit/PowerShellGet.ResourceHelper.Tests.ps1 rename to test/Unit/PowerShellGet.ResourceHelper.Tests.ps1 From 44fc9d62144b5bf441c859d36adde5c2d7b7fec6 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Thu, 6 Jan 2022 11:09:00 -0500 Subject: [PATCH 02/10] create .csproj file --- CHANGELOG.md | 155 ------------------------------- bootstrap.ps1 | 127 ------------------------- doBuild.ps1 | 4 - src/PowerShellGetDSC.psd1 | 63 +++++++++++++ src/code/PowerShellGetDSC.csproj | 38 ++++++++ 5 files changed, 101 insertions(+), 286 deletions(-) delete mode 100644 bootstrap.ps1 create mode 100644 src/PowerShellGetDSC.psd1 create mode 100644 src/code/PowerShellGetDSC.csproj diff --git a/CHANGELOG.md b/CHANGELOG.md index 596c9b2..f696af2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,158 +4,3 @@ ### Changes As of the PowerShellGet 3.0.12-beta preview release, PowerShellGetDSC was separated into its own repository. This first version makes this PowerShellGetDSC repository available and complete with testing and building capabilities. - -## 3.0.12-beta - -### Changes -- Support searching for all packages from a repository (i.e 'Find-PSResource -Name '*''). Note, wildcard search is not supported for AzureDevOps feed repositories and will write an error message accordingly). -- Packages found are now unique by Name,Version,Repository. -- Support searching for and returning packages found across multiple repositories when using wildcard with Repository parameter (i.e 'Find-PSResource -Name 'PackageExistingInMultipleRepos' -Repository '*'' will perform an exhaustive search). - - PSResourceInfo objects can be piped into: Install-PSResource, Uninstall-PSResource, Save-PSResource. PSRepositoryInfo objects can be piped into: Unregister-PSResourceRepository -- For more consistent pipeline support, the following cmdlets have pipeline support for the listed parameter(s): - - Find-PSResource (Name param, ValueFromPipeline) - - Get-PSResource (Name param, ValueFromPipeline) - - Install-PSResource (Name param, ValueFromPipeline) - - Publish-PSResource (None) - - Save-PSResource (Name param, ValueFromPipeline) - - Uninstall-PSResource (Name param, ValueFromPipeline) - - Update-PSResource (Name param, ValueFromPipeline) - - Get-PSResourceRepository (Name param, ValueFromPipeline) - - Set-PSResourceRepository (Name param, ValueFromPipeline) - - Register-PSResourceRepository (None) - - Unregister-PSResourceRepository (Name param, ValueFromPipelineByPropertyName) -- Implement '-Tag' parameter set for Find-PSResource (i.e 'Find-PSResource -Tag 'JSON'') -- Implement '-Type' parameter set for Find-PSResource (i.e 'Find-PSResource -Type Module') -- Implement CommandName and DSCResourceName parameter sets for Find-PSResource (i.e Find-PSResource -CommandName "Get-TargetResource"). -- Add consistent pre-release version support for cmdlets, including Uninstall-PSResource and Get-PSResource. For example, running 'Get-PSResource 'MyPackage' -Version '2.0.0-beta'' would only return MyPackage with version "2.0.0" and prerelease "beta", NOT MyPackage with version "2.0.0.0" (i.e a stable version). -- Add progress bar for installation completion for Install-PSResource, Update-PSResource and Save-PSResource. -- Implement '-Quiet' param for Install-PSResource, Save-PSResource and Update-PSResource. This suppresses the progress bar display when passed in. -- Implement '-PassThru' parameter for all appropriate cmdlets. Install-PSResource, Save-PSResource, Update-PSResource and Unregister-PSResourceRepository cmdlets now have '-PassThru' support thus completing this goal. -- Implement '-SkipDependencies' parameter for Install-PSResource, Save-PSResource, and Update-PSResource cmdlets. -- Implement '-AsNupkg' and '-IncludeXML' parameters for Save-PSResource. -- Implement '-DestinationPath' parameter for Publish-PSResource -- Add '-NoClobber' functionality to Install-PSResource. -- Add thorough error handling to Update-PSResource to cover more cases and gracefully write errors when updates can't be performed. -- Add thorough error handling to Install-PSResource to cover more cases and not fail silently when installation could not happen successfully. Also fixes bug where package would install even if it was already installed and '-Reinstall' parameter was not specified. -- Restore package if installation attempt fails when reinstalling a package. -- Fix bug with some Modules installing as Scripts. -- Fix bug with separating '$env:PSModulePath' to now work with path separators across all OS systems including Unix. -- Fix bug to register repositories with local file share paths, ensuring repositories with valid URIs can be registered. -- Revert cmdlet name 'Get-InstalledPSResource' to 'Get-PSResource' -- Remove DSCResources from PowerShellGet. -- Remove unnecessary assemblies. - -## 3.0.11-beta - -### Changes -- Graceful handling of paths that do not exist -- The repository store (PSResourceRepository.xml) is auto-generated if it does not already exist. It also automatically registers the PowerShellGallery with a default priority of 50 and a default trusted value of false. -- Better Linux support, including graceful exits when paths do not exist -- Better pipeline input support all cmdlets -- General wildcard support for all cmdlets -- WhatIf support for all cmdlets -- All cmdlets output concrete return types -- Better help documentation for all cmdlets -- Using an exact prerelease version with Find, Install, or Save no longer requires `-Prerelease` tag -- Support for finding, installing, saving, and updating PowerShell resources from Azure Artifact feeds -- Publish-PSResource now properly dispays 'Tags' in nuspec -- Find-PSResource quickly cancels transactions with 'CTRL + C' -- Register-PSRepository now handles relative paths -- Find-PSResource and Save-PSResource deduplicates dependencies -- Install-PSResource no longer creates version folder with the prerelease tag -- Update-PSResource can now update all resources, and no longer requires name param -- Save-PSResource properly handles saving scripts -- Get-InstalledPSResource uses default PowerShell paths - - -### Notes -In this release, all cmdlets have been reviewed and implementation code refactored as needed. -Cmdlets have most of their functionality, but some parameters are not yet implemented and will be added in future releases. -All tests have been reviewed and rewritten as needed. - - -## 3.0.0-beta10 -Bug Fixes -* Bug fix for -ModuleName (used with -Version) in Find-PSResource returning incorrect resource type -* Make repositories unique by name -* Add tab completion for -Name parameter in Get-PSResource, Set-PSResource, and Unregister-PSResource -* Remove credential argument from Register-PSResourceRepository -* Change returned version type from 'NuGet.Version' to 'System.Version' -* Have Install output verbose message on successful installation (error for unsuccessful installation) -* Ensure that not passing credentials does not throw an error if searching through multiple repositories -* Remove attempt to remove loaded assemblies in psm1 - -## 3.0.0-beta9 -New Features -* Add DSCResources - -Bug Fixes -* Fix bug related to finding dependencies that do not have a specified version in Find-PSResource -* Fix bug related to parsing 'RequiredModules' in .psd1 in Publish-PSResource -* Improve error handling for when repository in Publish-PSResource does not exist -* Fix for unix paths in Get-PSResource, Install-PSResource, and Uninstall-PSResource -* Add debugging statements for Get-PSResource and Install-PSResource -* Fix bug related to paths in Uninstall-PSResource - -## 3.0.0-beta8 -New Features -* Add Type parameter to Install-PSResource -* Add 'sudo' check for admin privileges in Unix in Install-PSResource - -Bug Fixes -* Fix bug with retrieving installed scripts in Get-PSResource -* Fix bug with AllUsers scope in Windows in Install-PSResource -* Fix bug with Uninstall-PSResource sometimes not fully uninstalling -* Change installed file paths to contain original version number instead of normalized version - -## 3.0.0-beta7 -New Features -* Completed functionality for Update-PSResource -* Input-Object parameter for Install-PSResource - -Bug Fixes -* Improved experience when loading module for diffent frameworks -* Bug fix for assembly loading error in Publish-PSResource -* Allow for relative paths when registering psrepository -* Improved error handling for Install-PSResource and Update-PSResource -* Remove prerelease tag from module version directory -* Fix error getting thrown from paths with incorrectly formatted module versions -* Fix module installation paths on Linux and MacOS - -## 3.0.0-beta6 -New Feature -* Implement functionality for Publish-PSResource - -## 3.0.0-beta5 -* Note: 3.0.0-beta5 was skipped due to a packaging error - -## 3.0.0-beta4 -New Feature -* Implement -Repository '*' in Find-PSResource to search through all repositories instead of prioritized repository - -Bug Fix -* Fix poor error handling for when repository is not accessible in Find-PSResource - -## 3.0.0-beta3 -New Features -* -RequiredResource parameter for Install-PSResource -* -RequiredResourceFile parameter for Install-PSResource -* -IncludeXML parameter in Save-PSResource - -Bug Fixes -* Resolved paths in Install-PSRsource and Save-PSResource -* Resolved issues with capitalization (for unix systems) in Install-PSResource and Save-PSResource - -## 3.0.0-beta2 -New Features -* Progress bar and -Quiet parameter for Install-PSResource -* -TrustRepository parameter for Install-PSResource -* -NoClobber parameter for Install-PSResource -* -AcceptLicense for Install-PSResource -* -Force parameter for Install-PSResource -* -Reinstall parameter for Install-PSResource -* Improved error handling - -## 3.0.0-beta1 -BREAKING CHANGE -* Preview version of PowerShellGet. Many features are not fully implemented yet. Please see https://devblogs.microsoft.com/powershell/powershellget-3-0-preview1 for more details. \ No newline at end of file diff --git a/bootstrap.ps1 b/bootstrap.ps1 deleted file mode 100644 index ab2e169..0000000 --- a/bootstrap.ps1 +++ /dev/null @@ -1,127 +0,0 @@ -## bootstrap.ps1 -# Use the .NET Core APIs to determine the current platform; if a runtime -# exception is thrown, we are on FullCLR, not .NET Core. -try { - $Runtime = [System.Runtime.InteropServices.RuntimeInformation] - $OSPlatform = [System.Runtime.InteropServices.OSPlatform] - - $IsCoreCLR = ($PSVersionTable.ContainsKey('PSEdition')) -and ($PSVersionTable.PSEdition -eq 'Core') - $IsLinux = $Runtime::IsOSPlatform($OSPlatform::Linux) - $IsMacOS = $Runtime::IsOSPlatform($OSPlatform::OSX) - $IsWindows = $Runtime::IsOSPlatform($OSPlatform::Windows) -} -catch { - # If these are already set, then they're read-only and we're done - try { - $IsCoreCLR = $false - $IsLinux = $false - $IsMacOS = $false - $IsWindows = $true - } - catch { } -} - -if ($IsLinux) { - $LinuxInfo = Get-Content /etc/os-release | ConvertFrom-StringData - - $IsUbuntu = $LinuxInfo.ID -match 'ubuntu' - $IsUbuntu14 = $IsUbuntu -and $LinuxInfo.VERSION_ID -match '14.04' - $IsUbuntu16 = $IsUbuntu -and $LinuxInfo.VERSION_ID -match '16.04' - $IsCentOS = $LinuxInfo.ID -match 'centos' -and $LinuxInfo.VERSION_ID -match '7' -} - -function Start-DotnetBootstrap { - [CmdletBinding( - SupportsShouldProcess = $true, - ConfirmImpact = "High")] - param( - [string]$Channel = "preview", - #[string]$Version = "latest", - # we currently pin dotnet-cli version, because tool - # is currently migrating to msbuild toolchain - # and requires constant updates to our build process. - [string]$Version = "2.1.503" - ) - - # Install ours and .NET's dependencies - $Deps = @() - if ($IsUbuntu) { - # Build tools - $Deps += "curl", "g++", "cmake", "make" - - # .NET Core required runtime libraries - $Deps += "libunwind8" - if ($IsUbuntu14) { $Deps += "libicu52" } - elseif ($IsUbuntu16) { $Deps += "libicu55" } - - # Install dependencies - sudo apt-get install -y -qq $Deps - } - elseif ($IsCentOS) { - # Build tools - $Deps += "which", "curl", "gcc-c++", "cmake", "make" - - # .NET Core required runtime libraries - $Deps += "libicu", "libunwind" - - # Install dependencies - sudo yum install -y -q $Deps - } - elseif ($IsMacOS) { - - # Build tools - $Deps += "curl", "cmake" - - # .NET Core required runtime libraries - $Deps += "openssl" - - # Install dependencies - brew install $Deps - } - - $obtainUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain" - - # Install for Linux and OS X - if ($IsLinux -or $IsMacOS) { - # Uninstall all previous dotnet packages - $uninstallScript = if ($IsUbuntu) { - "dotnet-uninstall-debian-packages.sh" - } - elseif ($IsMacOS) { - "dotnet-uninstall-pkgs.sh" - } - - if ($uninstallScript) { - curl -s $obtainUrl/uninstall/$uninstallScript -o $uninstallScript - chmod +x $uninstallScript - sudo ./$uninstallScript - } - else { - Write-Warning "This script only removes prior versions of dotnet for Ubuntu 14.04 and OS X" - } - - # Install new dotnet 1.0.0 preview packages - $installScript = "dotnet-install.sh" - curl -s $obtainUrl/$installScript -o $installScript - chmod +x $installScript - bash ./$installScript -c $Channel -v $Version - - # .NET Core's crypto library needs brew's OpenSSL libraries added to its rpath - if ($IsMacOS) { - # This is the library shipped with .NET Core - # This is allowed to fail as the user may have installed other versions of dotnet - Write-Warning ".NET Core links the incorrect OpenSSL, correcting .NET CLI libraries..." - find $env:HOME/.dotnet -name System.Security.Cryptography.Native.dylib | xargs sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib - } - } - - # Install for Windows - if ($IsWindows) { - Remove-Item -ErrorAction SilentlyContinue -Recurse -Force ~\AppData\Local\Microsoft\dotnet - $installScript = "dotnet-install.ps1" - Invoke-WebRequest -Uri $obtainUrl/$installScript -OutFile $installScript - & ./$installScript -c $Channel -Version $Version - } -} - -Start-DotnetBootstrap diff --git a/doBuild.ps1 b/doBuild.ps1 index 5e5ff78..df706bc 100644 --- a/doBuild.ps1 +++ b/doBuild.ps1 @@ -21,10 +21,6 @@ function DoBuild Write-Verbose -Verbose "Copy-Item ${SrcPath}/${ModuleName}.psd1 to $BuildOutPath" Copy-Item -Path "${SrcPath}/${ModuleName}.psd1" -Dest "$BuildOutPath" -Force - # #Copy module format ps1xml file - # Write-Verbose -Verbose -Message "Copy-Item ${SrcPath}/${FormatFileName}.ps1xml to $BuildOutPath" - # Copy-Item -Path "${SrcPath}/${FormatFileName}.ps1xml" -Dest "$BuildOutPath" -Force - # Create BuildFramework directory for binary location $BuildOutputBin = Join-Path -Path $BuildOutPath -ChildPath $BuildFramework if (! (Test-Path -Path $BuildOutputBin)) { diff --git a/src/PowerShellGetDSC.psd1 b/src/PowerShellGetDSC.psd1 new file mode 100644 index 0000000..9e56bc3 --- /dev/null +++ b/src/PowerShellGetDSC.psd1 @@ -0,0 +1,63 @@ +<# + This is a dummy PowerShell manifest file so that the DscResource.Tests + test framework recognize the module folder as correct (expected) folder + and file structure. + THIS FILE IS NOT USE DURING DEPLOYMENT. +#> +@{ + # Version number of this module. + moduleVersion = '0.0.0.1' + + # ID used to uniquely identify this module + GUID = 'e102ebd2-bdc3-4d0f-bc93-4b8cc3eb7074' + + # Author of this module + Author = 'Microsoft Corporation' + + # Company or vendor of this module + CompanyName = 'Microsoft Corporation' + + # Copyright statement for this module + Copyright = '(c) 2019 Microsoft Corporation. All rights reserved.' + + # Description of the functionality provided by this module + Description = 'Module with DSC Resources for deployment of PowerShell modules.' + + # Minimum version of the Windows PowerShell engine required by this module + PowerShellVersion = '5.0' + + # Minimum version of the common language runtime (CLR) required by this module + CLRVersion = '4.0' + + # Functions to export from this module + FunctionsToExport = @() + + # Cmdlets to export from this module + CmdletsToExport = @() + + RequiredAssemblies = @() + + <# + Private data to pass to the module specified in RootModule/ModuleToProcess. + This may also contain a PSData hashtable with additional module metadata used by PowerShell. + #> + PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResource') + + # A URL to the license for this module. + LicenseUri = 'https://github.com/PowerShell/PowerShellGet/blob/master/LICENSE' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/PowerShell/PowerShellGet' + + # ReleaseNotes of this module + ReleaseNotes = '' + + } # End of PSData hashtable + + } # End of PrivateData hashtable +} diff --git a/src/code/PowerShellGetDSC.csproj b/src/code/PowerShellGetDSC.csproj new file mode 100644 index 0000000..682e625 --- /dev/null +++ b/src/code/PowerShellGetDSC.csproj @@ -0,0 +1,38 @@ + + + + + Library + PowerShellGetDSC + PowerShellGetDSC + 1.0.0.0 + 1.0.0.0 + 1.0.0.0 + netstandard2.0 + 8.0 + + + + + + + From 0035618a6971465a708bcde860f6f0e786721816 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 10 Jan 2022 13:04:18 -0500 Subject: [PATCH 03/10] remove uneccessary assembly names from doBuild.ps1 --- doBuild.ps1 | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/doBuild.ps1 b/doBuild.ps1 index df706bc..130176c 100644 --- a/doBuild.ps1 +++ b/doBuild.ps1 @@ -49,6 +49,7 @@ function DoBuild # Build source Write-Verbose -Verbose -Message "Building with configuration: $BuildConfiguration, framework: $BuildFramework" Write-Verbose -Verbose -Message "Build location: PSScriptRoot: $PSScriptRoot, PWD: $pwd" + Write-Verbose -Verbose -Message "Anam: Build srcPath: $BuildSrcPath" dotnet publish --configuration $BuildConfiguration --framework $BuildFramework --output $BuildSrcPath -warnaserror if ($LASTEXITCODE -ne 0) { throw "Build failed with exit code: $LASTEXITCODE" @@ -56,18 +57,7 @@ function DoBuild # Place build results $assemblyNames = @( - 'PowerShellGet' - 'MoreLinq' - 'NuGet.Commands' - 'NuGet.Common' - 'NuGet.Configuration' - 'NuGet.Frameworks' - 'NuGet.Packaging' - 'NuGet.ProjectModel' - 'NuGet.Protocol' - 'NuGet.Repositories' - 'NuGet.Versioning' - 'Newtonsoft.Json' + 'PowerShellGetDSC' ) $buildSuccess = $true From 59c881ab332fdb1d0247a4fe87be2685e892b3c6 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 10 Jan 2022 17:18:08 -0500 Subject: [PATCH 04/10] remove C# build files, bin, out and instead copy code folders to src and out during build --- DSC.psd1 | 4 +- doBuild.ps1 | 84 +-- .../MSFT_PSModule/MSFT_PSModule.psm1 | 0 .../MSFT_PSModule/MSFT_PSModule.schema.mfl | 0 .../MSFT_PSModule/MSFT_PSModule.schema.mof | 0 .../en-US/MSFT_PSModule.strings.psd1 | 0 .../MSFT_PSRepository/MSFT_PSRepository.psm1 | 0 .../MSFT_PSRepository.schema.mfl | 0 .../MSFT_PSRepository.schema.mof | 0 .../en-US/MSFT_PSRepository.strings.psd1 | 0 .../PowerShellGet.LocalizationHelper.psm1 | 0 .../PowerShellGet.ResourceHelper.psm1 | 0 .../PowerShellGet.ResourceHelper.strings.psd1 | 0 .../MSFT_PSModule/MSFT_PSModule.psm1 | 625 ------------------ .../MSFT_PSModule/MSFT_PSModule.schema.mfl | 21 - .../MSFT_PSModule/MSFT_PSModule.schema.mof | 19 - .../en-US/MSFT_PSModule.strings.psd1 | 35 - .../MSFT_PSRepository/MSFT_PSRepository.psm1 | 273 -------- .../MSFT_PSRepository.schema.mfl | 15 - .../MSFT_PSRepository.schema.mof | 11 - .../en-US/MSFT_PSRepository.strings.psd1 | 22 - .../PowerShellGet.LocalizationHelper.psm1 | 254 ------- .../PowerShellGet.ResourceHelper.psm1 | 368 ----------- .../PowerShellGet.ResourceHelper.strings.psd1 | 29 - src/code/PowerShellGetDSC.csproj | 38 -- 25 files changed, 15 insertions(+), 1783 deletions(-) rename {DscResources => src/DscResources}/MSFT_PSModule/MSFT_PSModule.psm1 (100%) rename {DscResources => src/DscResources}/MSFT_PSModule/MSFT_PSModule.schema.mfl (100%) rename {DscResources => src/DscResources}/MSFT_PSModule/MSFT_PSModule.schema.mof (100%) rename {DscResources => src/DscResources}/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 (100%) rename {DscResources => src/DscResources}/MSFT_PSRepository/MSFT_PSRepository.psm1 (100%) rename {DscResources => src/DscResources}/MSFT_PSRepository/MSFT_PSRepository.schema.mfl (100%) rename {DscResources => src/DscResources}/MSFT_PSRepository/MSFT_PSRepository.schema.mof (100%) rename {DscResources => src/DscResources}/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 (100%) rename {Modules => src/Modules}/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 (100%) rename {Modules => src/Modules}/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 (100%) rename {Modules => src/Modules}/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 (100%) delete mode 100644 src/code/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 delete mode 100644 src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl delete mode 100644 src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof delete mode 100644 src/code/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 delete mode 100644 src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 delete mode 100644 src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl delete mode 100644 src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof delete mode 100644 src/code/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 delete mode 100644 src/code/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 delete mode 100644 src/code/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 delete mode 100644 src/code/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 delete mode 100644 src/code/PowerShellGetDSC.csproj diff --git a/DSC.psd1 b/DSC.psd1 index 9e56bc3..68c2113 100644 --- a/DSC.psd1 +++ b/DSC.psd1 @@ -6,7 +6,7 @@ #> @{ # Version number of this module. - moduleVersion = '0.0.0.1' + moduleVersion = '1.0.0.0' # ID used to uniquely identify this module GUID = 'e102ebd2-bdc3-4d0f-bc93-4b8cc3eb7074' @@ -27,7 +27,7 @@ PowerShellVersion = '5.0' # Minimum version of the common language runtime (CLR) required by this module - CLRVersion = '4.0' + # CLRVersion = '4.0' # Functions to export from this module FunctionsToExport = @() diff --git a/doBuild.ps1 b/doBuild.ps1 index 130176c..d07adf5 100644 --- a/doBuild.ps1 +++ b/doBuild.ps1 @@ -13,20 +13,19 @@ function DoBuild $BuildOutPath = "${OutDirectory}/${ModuleName}" Write-Verbose -Verbose -Message "Module output file path: '$BuildOutPath'" - # Module build source path - $BuildSrcPath = "bin/${BuildConfiguration}/${BuildFramework}/publish" - Write-Verbose -Verbose -Message "Module build source path: '$BuildSrcPath'" - # Copy module script files - Write-Verbose -Verbose "Copy-Item ${SrcPath}/${ModuleName}.psd1 to $BuildOutPath" + Write-Verbose -Verbose -Message "Copy-Item ${SrcPath}/${ModuleName}.psd1 to '$BuildOutPath'" Copy-Item -Path "${SrcPath}/${ModuleName}.psd1" -Dest "$BuildOutPath" -Force - # Create BuildFramework directory for binary location - $BuildOutputBin = Join-Path -Path $BuildOutPath -ChildPath $BuildFramework - if (! (Test-Path -Path $BuildOutputBin)) { - Write-Verbose -Verbose "Creating output path for binaries: $BuildOutputBin" - $null = New-Item -ItemType Directory -Path $BuildOutputBin - } + # Copy Modules folder into out directory + # Modules -> out/ModuleName/Modules + Write-Verbose -Verbose -Message "Copy-Item ${SrcPath}/Modules to '$BuildOutPath'" + Copy-Item -Path "${SrcPath}/Modules" -Dest "$BuildOutPath" -Force -Recurse + + # Copy DSCResources folder into out directory + # DSCResources -> out/ModuleName/DSCResources + Write-Verbose -Verbose -Message "Copy-Item ${SrcPath}/DSCResources to '$BuildOutPath'" + Copy-Item -Path "${SrcPath}/DSCResources" -Dest "$BuildOutPath" -Force -Recurse # Copy help Write-Verbose -Verbose -Message "Copying help files to '$BuildOutPath'" @@ -40,70 +39,13 @@ function DoBuild Write-Verbose -Verbose -Message "Copying ThirdPartyNotices.txt to '$BuildOutPath'" Copy-Item -Path "./Notice.txt" -Dest "$BuildOutPath" - # Build and place binaries + # Ensure code is in src directory if ( Test-Path "${SrcPath}/code" ) { - Write-Verbose -Verbose -Message "Building assembly and copying to '$BuildOutPath'" - # Build code and place it in the staging location - Push-Location "${SrcPath}/code" - try { - # Build source - Write-Verbose -Verbose -Message "Building with configuration: $BuildConfiguration, framework: $BuildFramework" - Write-Verbose -Verbose -Message "Build location: PSScriptRoot: $PSScriptRoot, PWD: $pwd" - Write-Verbose -Verbose -Message "Anam: Build srcPath: $BuildSrcPath" - dotnet publish --configuration $BuildConfiguration --framework $BuildFramework --output $BuildSrcPath -warnaserror - if ($LASTEXITCODE -ne 0) { - throw "Build failed with exit code: $LASTEXITCODE" - } - - # Place build results - $assemblyNames = @( - 'PowerShellGetDSC' - ) - - $buildSuccess = $true - foreach ($fileName in $assemblyNames) - { - # Copy bin file - $filePath = Join-Path -Path $BuildSrcPath -ChildPath "${fileName}.dll" - if (! (Test-Path -Path $filePath)) - { - Write-Error "Expected file $filePath is missing from build output." - $BuildSuccess = $false - continue - } - - Copy-Item -Path $filePath -Dest $BuildOutputBin -Verbose -Force - - # Copy pdb file if available - $filePathPdb = Join-Path -Path $BuildSrcPath -ChildPath "${fileName}.pdb" - if (Test-Path -Path $filePathPdb) - { - Copy-Item -Path $filePathPdb -Dest $BuildOutputBin -Verbose -Force - } - } - - if (! $buildSuccess) - { - throw "Build failed to create expected binaries." - } - - if (! (Test-Path -Path "$BuildSrcPath/${ModuleName}.dll")) - { - throw "Expected binary was not created: $BuildSrcPath/${ModuleName}.dll" - } - } - catch { - # Write-Error "dotnet build failed with error: $_" - Write-Verbose -Verbose -Message "dotnet build failed with error: $_" - } - finally { - Pop-Location - } + Write-Verbose -Verbose -Message "Source code found and copied to '$BuildOutPath'" } else { Write-Verbose -Verbose -Message "No code to build in '${SrcPath}/code'" } - ## Add build and packaging here - Write-Verbose -Verbose -Message "Ending DoBuild" + Write-Verbose -Verbose -Message "Ending build" } diff --git a/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 b/src/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 similarity index 100% rename from DscResources/MSFT_PSModule/MSFT_PSModule.psm1 rename to src/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 diff --git a/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl b/src/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl similarity index 100% rename from DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl rename to src/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl diff --git a/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof b/src/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof similarity index 100% rename from DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof rename to src/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof diff --git a/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 b/src/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 similarity index 100% rename from DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 rename to src/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 diff --git a/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 b/src/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 similarity index 100% rename from DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 rename to src/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 diff --git a/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl b/src/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl similarity index 100% rename from DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl rename to src/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl diff --git a/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof b/src/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof similarity index 100% rename from DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof rename to src/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof diff --git a/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 b/src/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 similarity index 100% rename from DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 rename to src/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 diff --git a/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 b/src/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 similarity index 100% rename from Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 rename to src/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 diff --git a/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 b/src/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 similarity index 100% rename from Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 rename to src/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 diff --git a/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 b/src/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 similarity index 100% rename from Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 rename to src/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 diff --git a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 deleted file mode 100644 index 2f58af1..0000000 --- a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.psm1 +++ /dev/null @@ -1,625 +0,0 @@ -# -# Copyright (c) Microsoft Corporation. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# - -$resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent - -# Import localization helper functions. -$helperName = 'PowerShellGet.LocalizationHelper' -$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" -Import-Module -Name $dscResourcesFolderFilePath - -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_PSModule' -ScriptRoot $PSScriptRoot - -# Import resource helper functions. -$helperName = 'PowerShellGet.ResourceHelper' -$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" -Import-Module -Name $dscResourcesFolderFilePath -Force - -<# - .SYNOPSIS - This DSC resource provides a mechanism to download PowerShell modules from the PowerShell - Gallery and install it on your computer. - - Get-TargetResource returns the current state of the resource. - - .PARAMETER Name - Specifies the name of the PowerShell module to be installed or uninstalled. - - .PARAMETER Repository - Specifies the name of the module source repository where the module can be found. - - .PARAMETER Version - Provides the version of the module you want to install or uninstall. - - .PARAMETER NoClobber - Does not allow the installation of modules if other existing module on the computer have cmdlets - of the same name. - - .PARAMETER SkipPublisherCheck - Allows the installation of modules that have not been catalog signed. -#> -function Get-TargetResource { - <# - These suppressions are added because this repository have other Visual Studio Code workspace - settings than those in DscResource.Tests DSC test framework. - Only those suppression that contradict this repository guideline is added here. - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-ForEachStatement', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] - [CmdletBinding()] - [OutputType([System.Collections.Hashtable])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $Name, - - [Parameter()] - [System.String] - $Repository = 'PSGallery', - - [Parameter()] - [System.String] - $Version, - - [Parameter()] - [System.Boolean] - $NoClobber, - - [Parameter()] - [System.Boolean] - $SkipPublisherCheck - ) - - $returnValue = @{ - Ensure = 'Absent' - Name = $Name - Repository = $Repository - Priority = $null - Description = $null - Guid = $null - ModuleBase = $null - ModuleType = $null - Author = $null - InstalledVersion = $null - Version = $Version - NoClobber = $NoClobber - SkipPublisherCheck = $SkipPublisherCheck - InstallationPolicy = $null - Trusted = $false - } - - Write-Verbose -Message ($localizedData.GetTargetResourceMessage -f $Name) - Write-Verbose("Name:") - - Write-Verbose("Name: $Name") - Write-Verbose("Repository: $Repository") - Write-Verbose("Version: $Version") - - $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` - -ArgumentNames ('Name', 'Repository', 'Version') - - # Get the module with the right version and repository properties. - $modules = Get-RightModule @extractedArguments -ErrorAction SilentlyContinue -WarningAction SilentlyContinue - - # If the module is found, the count > 0 - if ($modules.Count -gt 0) { - Write-Verbose -Message ($localizedData.ModuleFound -f $Name) - - # Find a module with the latest version and return its properties. - $latestModule = $modules[0] - - foreach ($module in $modules) { - if ($module.Version -gt $latestModule.Version) { - $latestModule = $module - } - } - - # Check if the repository matches. - $repositoryName = Get-ModuleRepositoryName -Module $latestModule -ErrorAction SilentlyContinue -WarningAction SilentlyContinue - - ##if ($repositoryName) { - ## $installationPolicy = Get-InstallationPolicy -RepositoryName $repositoryName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue - ##} - - ##if ($installationPolicy) { - ## $installationPolicyReturnValue = 'Trusted' - ## $Trusted = $true - ##} - ##else { - ##$installationPolicyReturnValue = 'Untrusted' - ##$Trusted = $false - ##} - - Write-Verbose("returning value") - $returnValue.Ensure = 'Present' - $returnValue.Repository = $repositoryName - $returnValue.Description = $latestModule.Description - $returnValue.Guid = $latestModule.Guid - $returnValue.ModuleBase = $latestModule.ModuleBase - $returnValue.ModuleType = $latestModule.ModuleType - $returnValue.Author = $latestModule.Author - $returnValue.InstalledVersion = $latestModule.Version - $returnValue.InstallationPolicy = $installationPolicyReturnValue - $returnValue.Trusted = $trusted - } - else { - Write-Verbose -Message ($localizedData.ModuleNotFound -f $Name) - } - - return $returnValue -} - -<# - .SYNOPSIS - This DSC resource provides a mechanism to download PowerShell modules from the PowerShell - Gallery and install it on your computer. - - Test-TargetResource validates whether the resource is currently in the desired state. - - .PARAMETER Ensure - Determines whether the module to be installed or uninstalled. - - .PARAMETER Name - Specifies the name of the PowerShell module to be installed or uninstalled. - - .PARAMETER Repository - Specifies the name of the module source repository where the module can be found. - - .PARAMETER InstallationPolicy - Determines whether you trust the source repository where the module resides. - - .PARAMETER Trusted - Determines whether you trust the source repository where the module resides. - - .PARAMETER Version - Provides the version of the module you want to install or uninstall. - - .PARAMETER NoClobber - Does not allow the installation of modules if other existing module on the computer have cmdlets - of the same name. - - .PARAMETER SkipPublisherCheck - Allows the installation of modules that have not been catalog signed. -#> -function Test-TargetResource { - <# - These suppressions are added because this repository have other Visual Studio Code workspace - settings than those in DscResource.Tests DSC test framework. - Only those suppression that contradict this repository guideline is added here. - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] - [CmdletBinding()] - [OutputType([System.Boolean])] - param - ( - [Parameter()] - [ValidateSet('Present', 'Absent')] - [System.String] - $Ensure = 'Present', - - [Parameter(Mandatory = $true)] - [System.String] - $Name, - - [Parameter()] - [System.String] - $Repository = 'PSGallery', - - [Parameter()] - [ValidateSet('Trusted', 'Untrusted')] - [System.String] - $InstallationPolicy = 'Untrusted', - - [Parameter()] - [System.Boolean] - $Trusted = $false, - - [Parameter()] - [System.String] - $Version, - - [Parameter()] - [System.Boolean] - $NoClobber, - - [Parameter()] - [System.Boolean] - $SkipPublisherCheck - ) - - Write-Verbose -Message ($localizedData.TestTargetResourceMessage -f $Name) - - $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` - -ArgumentNames ('Name', 'Repository', 'Version') - - $status = Get-TargetResource @extractedArguments - - # The ensure returned from Get-TargetResource is not equal to the desired $Ensure. - if ($status.Ensure -ieq $Ensure) { - Write-Verbose -Message ($localizedData.InDesiredState -f $Name) - return $true - } - else { - Write-Verbose -Message ($localizedData.NotInDesiredState -f $Name) - return $false - } -} - -<# - .SYNOPSIS - This DSC resource provides a mechanism to download PowerShell modules from the PowerShell - Gallery and install it on your computer. - - Set-TargetResource sets the resource to the desired state. "Make it so". - - .PARAMETER Ensure - Determines whether the module to be installed or uninstalled. - - .PARAMETER Name - Specifies the name of the PowerShell module to be installed or uninstalled. - - .PARAMETER Repository - Specifies the name of the module source repository where the module can be found. - - .PARAMETER InstallationPolicy - Determines whether you trust the source repository where the module resides. - - .PARAMETER Trusted - Determines whether you trust the source repository where the module resides. - - .PARAMETER Version - Provides the version of the module you want to install or uninstall. - - .PARAMETER NoClobber - Does not allow the installation of modules if other existing module on the computer have cmdlets - of the same name. - - .PARAMETER SkipPublisherCheck - Allows the installation of modules that have not been catalog signed. -#> -function Set-TargetResource { - <# - These suppressions are added because this repository have other Visual Studio Code workspace - settings than those in DscResource.Tests DSC test framework. - Only those suppression that contradict this repository guideline is added here. - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-ForEachStatement', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-TryStatement', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-CatchClause', '')] - [CmdletBinding()] - param - ( - [Parameter()] - [ValidateSet('Present', 'Absent')] - [System.String] - $Ensure = 'Present', - - [Parameter(Mandatory = $true)] - [System.String] - $Name, - - [Parameter()] - [System.String] - $Repository = 'PSGallery', - - [Parameter()] - [ValidateSet('Trusted', 'Untrusted')] - [System.String] - $InstallationPolicy = 'Untrusted', - - [Parameter()] - [System.Boolean] - $Trusted = $false, - - [Parameter()] - [System.String] - $Version, - - [Parameter()] - [System.Boolean] - $NoClobber, - - [Parameter()] - [System.Boolean] - $SkipPublisherCheck - ) - - # Validate the repository argument - if ($PSBoundParameters.ContainsKey('Repository')) { - #Test-ParameterValue -Value $Repository -Type 'PackageSource' -Verbose - } - - if ($Ensure -ieq 'Present') { - # Version check - $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` - -ArgumentNames ('Version') - - # $null = Test-VersionParameter @extractedArguments - - $trusted = $null - $moduleFound = $null - - try { - $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` - -ArgumentNames ('Name', 'Repository', 'Version') - - Write-Verbose -Message ($localizedData.StartFindModule -f $Name) - Write-verbose ("Name is: $name") - Write-verbose ("Repository is: $repository") - Write-verbose ("Version is: $Version") - - $modules = Find-PSResource @extractedArguments -ErrorVariable ev -ErrorAction SilentlyContinue - - Write-verbose ("modules is: $modules") - $moduleFound = $modules[0] - } - catch { - $errorMessage = $script:localizedData.ModuleNotFoundInRepository -f $Name - New-InvalidOperationException -Message $errorMessage -ErrorRecord $_ - } - - - foreach ($m in $modules) { - # Check for the installation policy. - #$trusted = Get-InstallationPolicy -RepositoryName $m.Repository -ErrorAction SilentlyContinue -WarningAction SilentlyContinue - - # Stop the loop if found a trusted repository. - #if ($trusted) { - # $moduleFound = $m - # break; - #} - } - - try { - # The repository is trusted, so we install it. - #if ($trusted) { - # Write-Verbose -Message ($localizedData.StartInstallModule -f $Name, $moduleFound.Version.toString(), $moduleFound.Repository) - - # Extract the installation options. - ## $extractedSwitches = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters -ArgumentNames ('Force', 'AllowClobber', 'SkipPublisherCheck') - - ## $moduleFound | Install-Module @extractedSwitches 2>&1 | out-string | Write-Verbose - Install-PSResource -name $moduleFound.Name -Repository $moduleFound.Repository -version $moduleFound.Version -TrustRepository:$true -NoClobber:$NoClobber -Verbose #$SkipPublisherCheck, - - ##} - # The repository is untrusted but user's installation policy is trusted, so we install it with a warning. - ##elseif ($InstallationPolicy -ieq $true) { - ## Write-Warning -Message ($localizedData.InstallationPolicyWarning -f $Name, $modules[0].Repository, $InstallationPolicy) - - # Extract installation options (Force implied by InstallationPolicy). - ## $extractedSwitches = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters -ArgumentNames ('AllowClobber', 'SkipPublisherCheck') - - # If all the repositories are untrusted, we choose the first one. - ## $modules[0] | Install-Module @extractedSwitches -Force 2>&1 | out-string | Write-Verbose - ## } - # Both user and repository is untrusted - ##else { - ## $errorMessage = $script:localizedData.InstallationPolicyFailed -f $InstallationPolicy, 'Untrusted' - ## New-InvalidOperationException -Message $errorMessage - ##} - - Write-Verbose -Message ($localizedData.InstalledSuccess -f $Name) - } - catch { - $errorMessage = $script:localizedData.FailToInstall -f $Name - New-InvalidOperationException -Message $errorMessage -ErrorRecord $_ - } - } - # Ensure=Absent - else { - - $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` - -ArgumentNames ('Name', 'Repository', 'Version') - - # Get the module with the right version and repository properties. - $modules = Get-RightModule @extractedArguments - - if (-not $modules) { - $errorMessage = $script:localizedData.ModuleWithRightPropertyNotFound -f $Name - New-InvalidOperationException -Message $errorMessage - } - - foreach ($module in $modules) { - # Get the path where the module is installed. - $path = $module.ModuleBase - - Write-Verbose -Message ($localizedData.StartUnInstallModule -f $Name) - - try { - <# - There is no Uninstall-Module cmdlet for Windows PowerShell 4.0, - so we will remove the ModuleBase folder as an uninstall operation. - #> - Microsoft.PowerShell.Management\Remove-Item -Path $path -Force -Recurse - - Write-Verbose -Message ($localizedData.UnInstalledSuccess -f $module.Name) - } - catch { - $errorMessage = $script:localizedData.FailToUninstall -f $module.Name - New-InvalidOperationException -Message $errorMessage -ErrorRecord $_ - } - } # foreach - } # Ensure=Absent -} - -<# - .SYNOPSIS - This is a helper function. It returns the modules that meet the specified versions and the repository requirements. - - .PARAMETER Name - Specifies the name of the PowerShell module. - - .PARAMETER Version - Provides the version of the module you want to install or uninstall. - - .PARAMETER Repository - Specifies the name of the module source repository where the module can be found. -#> -function Get-RightModule { - <# - These suppressions are added because this repository have other Visual Studio Code workspace - settings than those in DscResource.Tests DSC test framework. - Only those suppression that contradict this repository guideline is added here. - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-ForEachStatement', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Name, - - [Parameter()] - [System.String] - $Version, - - [Parameter()] - [System.String] - $Repository - ) - - Write-Verbose -Message ($localizedData.StartGetModule -f $($Name)) - - $modules = Microsoft.PowerShell.Core\Get-Module -Name $Name -ListAvailable -ErrorAction SilentlyContinue -WarningAction SilentlyContinue - - if (-not $modules) { - return $null - } - - <# - As Get-Module does not take RequiredVersion, MinimumVersion, MaximumVersion, or Repository, - below we need to check whether the modules are containing the right version and repository - location. - #> - - $extractedArguments = New-SplatParameterHashTable -FunctionBoundParameters $PSBoundParameters ` - -ArgumentNames ('Version') - $returnVal = @() - - foreach ($m in $modules) { - $versionMatch = $false - $installedVersion = $m.Version - - # Case 1 - a user provides none of RequiredVersion, MinimumVersion, MaximumVersion - if ($extractedArguments.Count -eq 0) { - $versionMatch = $true - } - - ########### COME BACK HERE - # Case 2 - a user provides RequiredVersion - elseif ($extractedArguments.ContainsKey('Version')) { - # Check if it matches with the installed version - $versionMatch = ($installedVersion -eq [System.Version] $RequiredVersion) - } - <# - else { - - # Case 3 - a user provides MinimumVersion - if ($extractedArguments.ContainsKey('MinimumVersion')) { - $versionMatch = ($installedVersion -ge [System.Version] $extractedArguments['MinimumVersion']) - } - - # Case 4 - a user provides MaximumVersion - if ($extractedArguments.ContainsKey('MaximumVersion')) { - $isLessThanMax = ($installedVersion -le [System.Version] $extractedArguments['MaximumVersion']) - - if ($extractedArguments.ContainsKey('MinimumVersion')) { - $versionMatch = $versionMatch -and $isLessThanMax - } - else { - $versionMatch = $isLessThanMax - } - } - - # Case 5 - Both MinimumVersion and MaximumVersion are provided. It's covered by the above. - # Do not return $false yet to allow the foreach to continue - if (-not $versionMatch) { - Write-Verbose -Message ($localizedData.VersionMismatch -f $Name, $installedVersion) - $versionMatch = $false - } - } - #> - - # Case 6 - Version matches but need to check if the module is from the right repository. - if ($versionMatch) { - # A user does not provide Repository, we are good - if (-not $PSBoundParameters.ContainsKey('Repository')) { - Write-Verbose -Message ($localizedData.ModuleFound -f "$Name $installedVersion") - $returnVal += $m - } - else { - # Check if the Repository matches - $sourceName = Get-ModuleRepositoryName -Module $m - - if ($Repository -ieq $sourceName) { - Write-Verbose -Message ($localizedData.ModuleFound -f "$Name $installedVersion") - $returnVal += $m - } - else { - Write-Verbose -Message ($localizedData.RepositoryMismatch -f $($Name), $($sourceName)) - } - } - } - } # foreach - - return $returnVal -} - -<# - .SYNOPSIS - This is a helper function that returns the module's repository name. - - .PARAMETER Module - Specifies the name of the PowerShell module. -#> -function Get-ModuleRepositoryName { - <# - These suppressions are added because this repository have other Visual Studio Code workspace - settings than those in DscResource.Tests DSC test framework. - Only those suppression that contradict this repository guideline is added here. - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.Object] - $Module - ) - - <# - RepositorySourceLocation property is supported in PS V5 only. To work with the earlier - PowerShell version, we need to do a different way. PSGetModuleInfo.xml exists for any - PowerShell modules downloaded through PSModule provider. - #> - $psGetModuleInfoFileName = 'PSGetModuleInfo.xml' - $psGetModuleInfoPath = Microsoft.PowerShell.Management\Join-Path -Path $Module.ModuleBase -ChildPath $psGetModuleInfoFileName - - Write-Verbose -Message ($localizedData.FoundModulePath -f $psGetModuleInfoPath) - - if (Microsoft.PowerShell.Management\Test-path -Path $psGetModuleInfoPath) { - $psGetModuleInfo = Microsoft.PowerShell.Utility\Import-Clixml -Path $psGetModuleInfoPath - - return $psGetModuleInfo.Repository - } -} diff --git a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl deleted file mode 100644 index db8de1e..0000000 --- a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mfl +++ /dev/null @@ -1,21 +0,0 @@ -#pragma namespace("\\\\.\\root\\default") -instance of __namespace{ name="MS_409";}; -#pragma namespace("\\\\.\\root\\default\\MS_409") - -[AMENDMENT, LOCALE("MS_409")] -class MSFT_PSModule : OMI_BaseResource -{ - [Key,Description("Name of the module\n") : Amended] String Name; - [Description("Whether the module is to be installed or uninstalled.\nPresent {default} \nAbsent \n") : Amended] String Ensure; - [Description("The name of the module source where the module can be found.\n") : Amended] String Repository; - [Description("Whether the package is trusted or untrusted.\nTrusted {default} \nUntrusted \n") : Amended] String InstallationPolicy; - [Description("The version of the module.\n") : Amended] String Version; - [Description("Does not allow installation when existing cmdlets of the same name exist.\n" : Amended] Boolean NoClobber; - [Description("Allows installation when module is not signed.\n" : Amended] Boolean SkipPublisherCheck; - [Description("The brief description of the module.\n") : Amended] string Description; - [Description("The version of the module that is installed.\n") : Amended] String InstalledVersion; - [Description("The identifier of the module.\n") : Amended] String Guid; - [Description("The base location where the module is installed.\n") : Amended] String ModuleBase; - [Description("The type of the module.\n") : Amended] String ModuleType; - [Description("The author of the module.\n") : Amended] String Author; -}; diff --git a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof b/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof deleted file mode 100644 index 4001858..0000000 --- a/src/code/DscResources/MSFT_PSModule/MSFT_PSModule.schema.mof +++ /dev/null @@ -1,19 +0,0 @@ - -[ClassVersion("1.0.0.0"),FriendlyName("PSModule")] -class MSFT_PSModule : OMI_BaseResource -{ - [Key] String Name; - [Write,ValueMap{"Present", "Absent"},Values{"Present", "Absent"}] String Ensure; - [Write] String Repository; - [Write,ValueMap{"Trusted", "Untrusted"},Values{"Trusted", "Untrusted"}] String InstallationPolicy; - [Write] Boolean Trusted; - [Write] String Version; - [Write] Boolean NoClobber; - [Write] Boolean SkipPublisherCheck; - [Read] string Description; - [Read] String InstalledVersion; - [Read] String Guid; - [Read] String ModuleBase; - [Read] String ModuleType; - [Read] String Author; -}; diff --git a/src/code/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 b/src/code/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 deleted file mode 100644 index e1a37ac..0000000 --- a/src/code/DscResources/MSFT_PSModule/en-US/MSFT_PSModule.strings.psd1 +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (c) Microsoft Corporation. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# culture = "en-US" -ConvertFrom-StringData -StringData @' - FailToUninstall = Failed to uninstall the module '{0}'. - FailToInstall = Failed to install the module '{0}'. - InDesiredState = Resource '{0}' is in the desired state. - NotInDesiredState = Resource '{0}' is not in the desired state. - ModuleFound = Module '{0}' is found on the node. - ModuleNotFound = Module '{0}' is not found on the node. - ModuleWithRightPropertyNotFound = Module '{0}' with the right version or other properties not found in the node. - ModuleNotFoundInRepository = Module '{0}' with the right version or other properties not found in the repository. - StartGetModule = Begin invoking Get-Module '{0}'. - StartFindModule = Begin invoking Find-PSResource '{0}'. - StartInstallModule = Begin invoking Install-PSResource '{0}' version '{1}' from '{2}' repository. - StartUnInstallModule = Begin invoking Remove-Item to remove the module '{0}' from the file system. - InstalledSuccess = Successfully installed the module '{0}' - UnInstalledSuccess = Successfully uninstalled the module '{0}' - VersionMismatch = The installed module '{0}' has the version: '{1}' - RepositoryMismatch = The installed module '{0}' is from the '{1}' repository. - FoundModulePath = Found the module path: '{0}'. - InstallationPolicyWarning = The module '{0}' was installed from the untrusted repository' {1}'. The InstallationPolicy is set to '{2}' to override the repository installation policy. If you trust the repository, set the repository installation policy to 'Trusted', that will also remove this warning. - InstallationPolicyFailed = The current installation policy do not allow installation from this repository. Your current installation policy is '{0}' and the repository installation policy is '{1}'. If you trust the repository, either change the repository installation policy, or set the parameter InstallationPolicy to 'Trusted' to override the repository installation policy. - GetTargetResourceMessage = Getting the current state of the module '{0}'. - TestTargetResourceMessage = Determining if the module '{0}' is in the desired state. -'@ diff --git a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 deleted file mode 100644 index 30c0dfe..0000000 --- a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.psm1 +++ /dev/null @@ -1,273 +0,0 @@ -$resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent - -# Import localization helper functions. -$helperName = 'PowerShellGet.LocalizationHelper' -$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" -Import-Module -Name $dscResourcesFolderFilePath - -$script:localizedData = Get-LocalizedData -ResourceName 'MSFT_PSRepository' -ScriptRoot $PSScriptRoot - -# Import resource helper functions. -$helperName = 'PowerShellGet.ResourceHelper' -$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" -Import-Module -Name $dscResourcesFolderFilePath - -<# - .SYNOPSIS - Returns the current state of the repository. - - .PARAMETER Name - Specifies the name of the repository to manage. -#> -function Get-TargetResource { - <# - These suppressions are added because this repository have other Visual Studio Code workspace - settings than those in DscResource.Tests DSC test framework. - Only those suppression that contradict this repository guideline is added here. - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] - [CmdletBinding()] - [OutputType([System.Collections.Hashtable])] - param - ( - [Parameter(Mandatory = $true)] - [System.String] - $Name - ) - - $returnValue = @{ - Ensure = 'Absent' - Name = $Name - URL = $null - Priority = $null - #InstallationPolicy = $null - #Trusted = $false - Registered = $false - } - - Write-Verbose -Message ($localizedData.GetTargetResourceMessage -f $Name) - - $repository = Get-PSResourceRepository -Name $Name -ErrorAction 'SilentlyContinue' - - if ($repository) { - $returnValue.Ensure = 'Present' - $returnValue.SourceLocation = $repository.SourceLocation - $returnValue.ScriptSourceLocation = $repository.ScriptSourceLocation - $returnValue.PublishLocation = $repository.PublishLocation - $returnValue.ScriptPublishLocation = $repository.ScriptPublishLocation - $returnValue.InstallationPolicy = $repository.InstallationPolicy - $returnValue.PackageManagementProvider = $repository.PackageManagementProvider - $returnValue.Trusted = $repository.Trusted - $returnValue.Registered = $repository.Registered - } - else { - Write-Verbose -Message ($localizedData.RepositoryNotFound -f $Name) - } - - return $returnValue -} - -<# - .SYNOPSIS - Determines if the repository is in the desired state. - - .PARAMETER Ensure - If the repository should be present or absent on the server - being configured. Default values is 'Present'. - - .PARAMETER Name - Specifies the name of the repository to manage. - - .PARAMETER SourceLocation - Specifies the URI for discovering and installing modules from - this repository. A URI can be a NuGet server feed, HTTP, HTTPS, - FTP or file location. - - .PARAMETER ScriptSourceLocation - Specifies the URI for the script source location. - - .PARAMETER PublishLocation - Specifies the URI of the publish location. For example, for - NuGet-based repositories, the publish location is similar - to http://someNuGetUrl.com/api/v2/Packages. - - .PARAMETER ScriptPublishLocation - Specifies the URI for the script publish location. - - .PARAMETER InstallationPolicy - Specifies the installation policy. Valid values are 'Trusted' - or 'Untrusted'. The default value is 'Untrusted'. - - .PARAMETER PackageManagementProvider - Specifies a OneGet package provider. Default value is 'NuGet'. -#> -function Test-TargetResource { - <# - These suppressions are added because this repository have other Visual Studio Code workspace - settings than those in DscResource.Tests DSC test framework. - Only those suppression that contradict this repository guideline is added here. - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] - [CmdletBinding()] - [OutputType([System.Boolean])] - param - ( - [Parameter()] - [ValidateSet('Present', 'Absent')] - [System.String] - $Ensure = 'Present', - - [Parameter(Mandatory = $true)] - [System.String] - $Name, - - [Parameter()] - [System.String] - $URL, - - [Parameter()] - [System.String] - $Priority, - - [Parameter()] - [ValidateSet('Trusted', 'Untrusted')] - [System.String] - $InstallationPolicy = 'Untrusted' - ) - - Write-Verbose -Message ($localizedData.TestTargetResourceMessage -f $Name) - - $returnValue = $false - - $getTargetResourceResult = Get-TargetResource -Name $Name - - if ($Ensure -eq $getTargetResourceResult.Ensure) { - if ($getTargetResourceResult.Ensure -eq 'Present' ) { - $returnValue = Test-DscParameterState ` - -CurrentValues $getTargetResourceResult ` - -DesiredValues $PSBoundParameters ` - -ValuesToCheck @( - 'URL' - 'Priority' - #'InstallationPolicy' - ) - } - else { - $returnValue = $true - } - } - - if ($returnValue) { - Write-Verbose -Message ($localizedData.InDesiredState -f $Name) - } - else { - Write-Verbose -Message ($localizedData.NotInDesiredState -f $Name) - } - - return $returnValue -} - -<# - .SYNOPSIS - Creates, removes or updates the repository. - - .PARAMETER Ensure - If the repository should be present or absent on the server - being configured. Default values is 'Present'. - - .PARAMETER Name - Specifies the name of the repository to manage. - - .PARAMETER SourceLocation - Specifies the URI for discovering and installing modules from - this repository. A URI can be a NuGet server feed, HTTP, HTTPS, - FTP or file location. - - .PARAMETER ScriptSourceLocation - Specifies the URI for the script source location. - - .PARAMETER PublishLocation - Specifies the URI of the publish location. For example, for - NuGet-based repositories, the publish location is similar - to http://someNuGetUrl.com/api/v2/Packages. - - .PARAMETER ScriptPublishLocation - Specifies the URI for the script publish location. - - .PARAMETER InstallationPolicy - Specifies the installation policy. Valid values are 'Trusted' - or 'Untrusted'. The default value is 'Untrusted'. - - .PARAMETER PackageManagementProvider - Specifies a OneGet package provider. Default value is 'NuGet'. -#> -function Set-TargetResource { - <# - These suppressions are added because this repository have other Visual Studio Code workspace - settings than those in DscResource.Tests DSC test framework. - Only those suppression that contradict this repository guideline is added here. - #> - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-FunctionBlockBraces', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('DscResource.AnalyzerRules\Measure-IfStatement', '')] - [CmdletBinding()] - param - ( - [Parameter()] - [ValidateSet('Present', 'Absent')] - [System.String] - $Ensure = 'Present', - - [Parameter(Mandatory = $true)] - [System.String] - $Name, - - [Parameter()] - [System.String] - $URL, - - [Parameter()] - [ValidateSet('Trusted', 'Untrusted')] - [System.String] - $InstallationPolicy = 'Untrusted' - ) - - $getTargetResourceResult = Get-TargetResource -Name $Name - - Write-Verbose("Name: $Name") - Write-Verbose("URL: $URL") - # Determine if the repository should be present or absent. - if ($Ensure -eq 'Present') { - $repositoryParameters = New-SplatParameterHashTable ` - -FunctionBoundParameters $PSBoundParameters ` - -ArgumentNames @( - 'Name' - 'URL' - #'InstallationPolicy' - ) - - # Determine if the repository is already present. - if ($getTargetResourceResult.Ensure -eq 'Present') { - Write-Verbose -Message ($localizedData.RepositoryExist -f $Name) - - # Repository exist, update the properties. - Set-PSResourceRepository @repositoryParameters -ErrorAction 'Stop' - } - else { - Write-Verbose -Message ($localizedData.RepositoryDoesNotExist -f $Name) - - # Repository did not exist, create the repository. - Register-PSResourceRepository @repositoryParameters -ErrorAction 'Stop' - } - } - else { - if ($getTargetResourceResult.Ensure -eq 'Present') { - Write-Verbose -Message ($localizedData.RemoveExistingRepository -f $Name) - - # Repository did exist, remove the repository. - Unregister-PSResourceRepository -Name $Name -ErrorAction 'Stop' - } - } -} diff --git a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl deleted file mode 100644 index 20d1871..0000000 --- a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mfl +++ /dev/null @@ -1,15 +0,0 @@ -#pragma namespace("\\\\.\\root\\default") -instance of __namespace{ name="MS_409";}; -#pragma namespace("\\\\.\\root\\default\\MS_409") - -[AMENDMENT, LOCALE("MS_409")] -class MSFT_PSModule : OMI_BaseResource -{ - [Key, Description("Specifies the name of the repository to manage.") : Amended] String Name; - [Description("If the repository should be present or absent on the server being configured. Default values is 'Present'.") : Amended] String Ensure; - [Description("Specifies the URI for discovering and installing modules from this repository. A URI can be a NuGet server feed, HTTP, HTTPS, FTP or file location.") : Amended] String URL; - [Description("Specifies the priority for the repository.") : Amended] String Priority; - [Description("Specifies the installation policy. Valid values are 'Trusted' or 'Untrusted'. The default value is 'Untrusted'.") : Amended] String InstallationPolicy; - [Description("Specifies if the repository is trusted.") : Amended] Boolean Trusted; - [Description("Specifies if the repository is registered.") : Amended] Boolean Registered; -}; diff --git a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof b/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof deleted file mode 100644 index 46dcb7f..0000000 --- a/src/code/DscResources/MSFT_PSRepository/MSFT_PSRepository.schema.mof +++ /dev/null @@ -1,11 +0,0 @@ -[ClassVersion("1.0.0.0"),FriendlyName("PSRepository")] -class MSFT_PSRepository : OMI_BaseResource -{ - [Key] String Name; - [Write, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure; - [Write] String URL; - [Write] String Priority; - [Write, ValueMap{"Trusted","Untrusted"}, Values{"Trusted","Untrusted"}] String InstallationPolicy; - [Read] Boolean Trusted; - [Read] Boolean Registered; -}; diff --git a/src/code/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 b/src/code/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 deleted file mode 100644 index 81c7c75..0000000 --- a/src/code/DscResources/MSFT_PSRepository/en-US/MSFT_PSRepository.strings.psd1 +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (c) Microsoft Corporation. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# culture = "en-US" -ConvertFrom-StringData -StringData @' - GetTargetResourceMessage = Return the current state of the repository '{0}'. - RepositoryNotFound = The repository '{0}' was not found. - TestTargetResourceMessage = Determining if the repository '{0}' is in the desired state. - InDesiredState = Repository '{0}' is in the desired state. - NotInDesiredState = Repository '{0}' is not in the desired state. - RepositoryExist = Updating the properties of the repository '{0}'. - RepositoryDoesNotExist = Creating the repository '{0}'. - RemoveExistingRepository = Removing the repository '{0}'. -'@ diff --git a/src/code/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 b/src/code/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 deleted file mode 100644 index 9f6b612..0000000 --- a/src/code/Modules/PowerShellGet.LocalizationHelper/PowerShellGet.LocalizationHelper.psm1 +++ /dev/null @@ -1,254 +0,0 @@ -<# - .SYNOPSIS - Creates and throws an invalid argument exception. - - .PARAMETER Message - The message explaining why this error is being thrown. - - .PARAMETER ArgumentName - The name of the invalid argument that is causing this error to be thrown. -#> -function New-InvalidArgumentException { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Message, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $ArgumentName - ) - - $argumentException = New-Object -TypeName 'ArgumentException' ` - -ArgumentList @($Message, $ArgumentName) - - $newObjectParameters = @{ - TypeName = 'System.Management.Automation.ErrorRecord' - ArgumentList = @($argumentException, $ArgumentName, 'InvalidArgument', $null) - } - - $errorRecord = New-Object @newObjectParameters - - throw $errorRecord -} - -<# - .SYNOPSIS - Creates and throws an invalid operation exception. - - .PARAMETER Message - The message explaining why this error is being thrown. - - .PARAMETER ErrorRecord - The error record containing the exception that is causing this terminating error. -#> -function New-InvalidOperationException { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Message, - - [Parameter()] - [ValidateNotNull()] - [System.Management.Automation.ErrorRecord] - $ErrorRecord - ) - - if ($null -eq $ErrorRecord) { - $invalidOperationException = New-Object -TypeName 'InvalidOperationException' ` - -ArgumentList @($Message) - } - else { - $invalidOperationException = New-Object -TypeName 'InvalidOperationException' ` - -ArgumentList @($Message, $ErrorRecord.Exception) - } - - $newObjectParameters = @{ - TypeName = 'System.Management.Automation.ErrorRecord' - ArgumentList = @( - $invalidOperationException.ToString(), - 'MachineStateIncorrect', - 'InvalidOperation', - $null - ) - } - - $errorRecordToThrow = New-Object @newObjectParameters - - throw $errorRecordToThrow -} - -<# - .SYNOPSIS - Creates and throws an object not found exception. - - .PARAMETER Message - The message explaining why this error is being thrown. - - .PARAMETER ErrorRecord - The error record containing the exception that is causing this terminating error. -#> -function New-ObjectNotFoundException { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Message, - - [Parameter()] - [ValidateNotNull()] - [System.Management.Automation.ErrorRecord] - $ErrorRecord - ) - - if ($null -eq $ErrorRecord) { - $exception = New-Object -TypeName 'System.Exception' ` - -ArgumentList @($Message) - } - else { - $exception = New-Object -TypeName 'System.Exception' ` - -ArgumentList @($Message, $ErrorRecord.Exception) - } - - $newObjectParameters = @{ - TypeName = 'System.Management.Automation.ErrorRecord' - ArgumentList = @( - $exception.ToString(), - 'MachineStateIncorrect', - 'ObjectNotFound', - $null - ) - } - - $errorRecordToThrow = New-Object @newObjectParameters - - throw $errorRecordToThrow -} - -<# - .SYNOPSIS - Creates and throws an invalid result exception. - - .PARAMETER Message - The message explaining why this error is being thrown. - - .PARAMETER ErrorRecord - The error record containing the exception that is causing this terminating error. -#> -function New-InvalidResultException { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Message, - - [Parameter()] - [ValidateNotNull()] - [System.Management.Automation.ErrorRecord] - $ErrorRecord - ) - - if ($null -eq $ErrorRecord) { - $exception = New-Object -TypeName 'System.Exception' ` - -ArgumentList @($Message) - } - else { - $exception = New-Object -TypeName 'System.Exception' ` - -ArgumentList @($Message, $ErrorRecord.Exception) - } - - $newObjectParameters = @{ - TypeName = 'System.Management.Automation.ErrorRecord' - ArgumentList = @( - $exception.ToString(), - 'MachineStateIncorrect', - 'InvalidResult', - $null - ) - } - - $errorRecordToThrow = New-Object @newObjectParameters - - throw $errorRecordToThrow -} - -<# - .SYNOPSIS - Retrieves the localized string data based on the machine's culture. - Falls back to en-US strings if the machine's culture is not supported. - - .PARAMETER ResourceName - The name of the resource as it appears before '.strings.psd1' of the localized string file. - For example: - For WindowsOptionalFeature: MSFT_WindowsOptionalFeature - For Service: MSFT_ServiceResource - For Registry: MSFT_RegistryResource - For Helper: SqlServerDscHelper - - .PARAMETER ScriptRoot - Optional. The root path where to expect to find the culture folder. This is only needed - for localization in helper modules. This should not normally be used for resources. -#> -function Get-LocalizedData { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $ResourceName, - - [Parameter()] - [ValidateNotNullOrEmpty()] - [System.String] - $ScriptRoot - ) - - if ( -not $ScriptRoot ) { - $resourceDirectory = Join-Path -Path $PSScriptRoot -ChildPath $ResourceName - $localizedStringFileLocation = Join-Path -Path $resourceDirectory -ChildPath $PSUICulture - } - else { - $localizedStringFileLocation = Join-Path -Path $ScriptRoot -ChildPath $PSUICulture - } - - if (-not (Test-Path -Path $localizedStringFileLocation)) { - # Fallback to en-US - if ( -not $ScriptRoot ) { - $localizedStringFileLocation = Join-Path -Path $resourceDirectory -ChildPath 'en-US' - } - else { - $localizedStringFileLocation = Join-Path -Path $ScriptRoot -ChildPath 'en-US' - } - } - - Import-LocalizedData ` - -BindingVariable 'localizedData' ` - -FileName "$ResourceName.strings.psd1" ` - -BaseDirectory $localizedStringFileLocation - - return $localizedData -} - -Export-ModuleMember -Function @( - 'New-InvalidArgumentException', - 'New-InvalidOperationException', - 'New-ObjectNotFoundException', - 'New-InvalidResultException', - 'Get-LocalizedData' -) diff --git a/src/code/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 b/src/code/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 deleted file mode 100644 index 2a01934..0000000 --- a/src/code/Modules/PowerShellGet.ResourceHelper/PowerShellGet.ResourceHelper.psm1 +++ /dev/null @@ -1,368 +0,0 @@ -# -# Copyright (c) Microsoft Corporation. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# - -<# - Helper functions for PowerShellGet DSC Resources. -#> - -# Import localization helper functions. -$helperName = 'PowerShellGet.LocalizationHelper' -$resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent -$dscResourcesFolderFilePath = Join-Path -Path $resourceModuleRoot -ChildPath "Modules\$helperName\$helperName.psm1" -Import-Module -Name $dscResourcesFolderFilePath - -# Import Localization Strings -$script:localizedData = Get-LocalizedData -ResourceName 'PowerShellGet.ResourceHelper' -ScriptRoot $PSScriptRoot - -<# - .SYNOPSIS - This is a helper function that extract the parameters from a given table. - - .PARAMETER FunctionBoundParameters - Specifies the hash table containing a set of parameters to be extracted. - - .PARAMETER ArgumentNames - Specifies a list of arguments you want to extract. -#> -function New-SplatParameterHashTable { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')] - [CmdletBinding()] - [OutputType([System.Collections.Hashtable])] - param - ( - [Parameter(Mandatory = $true)] - [System.Collections.Hashtable] - $FunctionBoundParameters, - - [Parameter(Mandatory = $true)] - [System.String[]] - $ArgumentNames - ) - - Write-Verbose -Message ($script:localizedData.CallingFunction -f $($MyInvocation.MyCommand)) - - $returnValue = @{} - - foreach ($arg in $ArgumentNames) { - if ($FunctionBoundParameters.ContainsKey($arg)) { - # Found an argument we are looking for, so we add it to return collection. - $returnValue.Add($arg, $FunctionBoundParameters[$arg]) - } - } - - return $returnValue -} - -<# - .SYNOPSIS - This is a helper function that validate that a value is correct and used correctly. - - .PARAMETER Value - Specifies the value to be validated. - - .PARAMETER Type - Specifies the type of argument. - - .PARAMETER Type - Specifies the name of the provider. - - .OUTPUTS - None. Throws an error if the test fails. -#> -function Test-ParameterValue { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')] - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Value, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $Type, - - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] - $ProviderName - ) - - Write-Verbose -Message ($script:localizedData.CallingFunction -f $($MyInvocation.MyCommand)) - - switch ($Type) { - 'SourceUri' { - # Checks whether given URI represents specific scheme - # Most common schemes: file, http, https, ftp - $scheme = @('http', 'https', 'file', 'ftp') - - $newUri = $Value -as [System.URI] - $returnValue = ($newUri -and $newUri.AbsoluteURI -and ($scheme -icontains $newUri.Scheme)) - - if ($returnValue -eq $false) { - $errorMessage = $script:localizedData.InValidUri -f $Value - New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage - } - } - - 'DestinationPath' { - $returnValue = Test-Path -Path $Value - - if ($returnValue -eq $false) { - $errorMessage = $script:localizedData.PathDoesNotExist -f $Value - New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage - } - } - - <# - 'PackageSource' { - # Value can be either the package source Name or source Uri. - # Check if the source is a Uri. - $uri = $Value -as [System.URI] - - if ($uri -and $uri.AbsoluteURI) { - # Check if it's a valid Uri. - Test-ParameterValue -Value $Value -Type 'SourceUri' -ProviderName $ProviderName - } - else { - # Check if it's a registered package source name. - # $source = PackageManagement\Get-PackageSource -Name $Value -ProviderName $ProviderName -ErrorVariable ev - - if ((-not $source) -or $ev) { - # We do not need to throw error here as Get-PackageSource does already. - Write-Verbose -Message ($script:localizedData.SourceNotFound -f $source) - } - } - } #> - - default { - $errorMessage = $script:localizedData.UnexpectedArgument -f $Type - New-InvalidArgumentException -ArgumentName $Type -Message $errorMessage - } - } -} - -<# - .SYNOPSIS - This is a helper function that does the version validation. - - .PARAMETER Version - Provides the version. -#> -function Test-VersionParameter { - [CmdletBinding()] - param - ( - [Parameter()] - [System.String] - $Version - ) - - Write-Verbose -Message ($localizedData.CallingFunction -f $($MyInvocation.MyCommand)) - - $isValid = $false - - # Case 1: No further check required if a user provides either none or one of these: minimumVersion, maximumVersion, and requiredVersion. - if ($PSBoundParameters.Count -le 1) { - return $true - } - - ########## COME BACK HERE - # Case 2: #If no RequiredVersion is provided. - #if (-not $PSBoundParameters.ContainsKey('Version')) { - # If no RequiredVersion, both MinimumVersion and MaximumVersion are provided. Otherwise fall into the Case #1. - #$isValid = $PSBoundParameters['MinimumVersion'] -le $PSBoundParameters['MaximumVersion'] - #} - $isValid = $true - # Case 3: RequiredVersion is provided. - # In this case MinimumVersion and/or MaximumVersion also are provided. Otherwise fall in to Case #1. - # This is an invalid case. When RequiredVersion is provided, others are not allowed. so $isValid is false, which is already set in the init. - - if ($isValid -eq $false) { - $errorMessage = $script:localizedData.VersionError - New-InvalidArgumentException ` - -ArgumentName 'RequiredVersion, MinimumVersion or MaximumVersion' ` - -Message $errorMessage - } -} - -<# - .SYNOPSIS - This is a helper function that retrieves the InstallationPolicy from the given repository. - - .PARAMETER RepositoryName - Provides the repository Name. -#> -function Get-InstallationPolicy { - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [ValidateNotNullOrEmpty()] - [System.String] $RepositoryName - ) - - Write-Verbose -Message ($LocalizedData.CallingFunction -f $($MyInvocation.MyCommand)) - - $repositoryObject = Get-PSResourceRepository -Name $RepositoryName -ErrorAction SilentlyContinue -WarningAction SilentlyContinue - - if ($repositoryObject) { - return $repositoryObject.IsTrusted - } -} - -<# - .SYNOPSIS - This method is used to compare current and desired values for any DSC resource. - - .PARAMETER CurrentValues - This is hash table of the current values that are applied to the resource. - - .PARAMETER DesiredValues - This is a PSBoundParametersDictionary of the desired values for the resource. - - .PARAMETER ValuesToCheck - This is a list of which properties in the desired values list should be checked. - If this is empty then all values in DesiredValues are checked. -#> -function Test-DscParameterState { - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', '')] - [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '')] - [CmdletBinding()] - param - ( - [Parameter(Mandatory = $true)] - [System.Collections.Hashtable] - $CurrentValues, - - [Parameter(Mandatory = $true)] - [System.Object] - $DesiredValues, - - [Parameter()] - [System.Array] - $ValuesToCheck - ) - - $returnValue = $true - - if (($DesiredValues.GetType().Name -ne 'HashTable') ` - -and ($DesiredValues.GetType().Name -ne 'CimInstance') ` - -and ($DesiredValues.GetType().Name -ne 'PSBoundParametersDictionary')) { - $errorMessage = $script:localizedData.PropertyTypeInvalidForDesiredValues -f $($DesiredValues.GetType().Name) - New-InvalidArgumentException -ArgumentName 'DesiredValues' -Message $errorMessage - } - - if (($DesiredValues.GetType().Name -eq 'CimInstance') -and ($null -eq $ValuesToCheck)) { - $errorMessage = $script:localizedData.PropertyTypeInvalidForValuesToCheck - New-InvalidArgumentException -ArgumentName 'ValuesToCheck' -Message $errorMessage - } - - if (($null -eq $ValuesToCheck) -or ($ValuesToCheck.Count -lt 1)) { - $keyList = $DesiredValues.Keys - } - else { - $keyList = $ValuesToCheck - } - - $keyList | ForEach-Object -Process { - if (($_ -ne 'Verbose')) { - if (($CurrentValues.ContainsKey($_) -eq $false) ` - -or ($CurrentValues.$_ -ne $DesiredValues.$_) ` - -or (($DesiredValues.GetType().Name -ne 'CimInstance' -and $DesiredValues.ContainsKey($_) -eq $true) -and ($null -ne $DesiredValues.$_ -and $DesiredValues.$_.GetType().IsArray))) { - if ($DesiredValues.GetType().Name -eq 'HashTable' -or ` - $DesiredValues.GetType().Name -eq 'PSBoundParametersDictionary') { - $checkDesiredValue = $DesiredValues.ContainsKey($_) - } - else { - # If DesiredValue is a CimInstance. - $checkDesiredValue = $false - if (([System.Boolean]($DesiredValues.PSObject.Properties.Name -contains $_)) -eq $true) { - if ($null -ne $DesiredValues.$_) { - $checkDesiredValue = $true - } - } - } - - if ($checkDesiredValue) { - $desiredType = $DesiredValues.$_.GetType() - $fieldName = $_ - if ($desiredType.IsArray -eq $true) { - if (($CurrentValues.ContainsKey($fieldName) -eq $false) ` - -or ($null -eq $CurrentValues.$fieldName)) { - Write-Verbose -Message ($script:localizedData.PropertyValidationError -f $fieldName) -Verbose - - $returnValue = $false - } - else { - $arrayCompare = Compare-Object -ReferenceObject $CurrentValues.$fieldName ` - -DifferenceObject $DesiredValues.$fieldName - if ($null -ne $arrayCompare) { - Write-Verbose -Message ($script:localizedData.PropertiesDoesNotMatch -f $fieldName) -Verbose - - $arrayCompare | ForEach-Object -Process { - Write-Verbose -Message ($script:localizedData.PropertyThatDoesNotMatch -f $_.InputObject, $_.SideIndicator) -Verbose - } - - $returnValue = $false - } - } - } - else { - switch ($desiredType.Name) { - 'String' { - if (-not [System.String]::IsNullOrEmpty($CurrentValues.$fieldName) -or ` - -not [System.String]::IsNullOrEmpty($DesiredValues.$fieldName)) { - Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` - -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose - - $returnValue = $false - } - } - - 'Int32' { - if (-not ($DesiredValues.$fieldName -eq 0) -or ` - -not ($null -eq $CurrentValues.$fieldName)) { - Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` - -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose - - $returnValue = $false - } - } - - { $_ -eq 'Int16' -or $_ -eq 'UInt16'} { - if (-not ($DesiredValues.$fieldName -eq 0) -or ` - -not ($null -eq $CurrentValues.$fieldName)) { - Write-Verbose -Message ($script:localizedData.ValueOfTypeDoesNotMatch ` - -f $desiredType.Name, $fieldName, $($CurrentValues.$fieldName), $($DesiredValues.$fieldName)) -Verbose - - $returnValue = $false - } - } - - default { - Write-Warning -Message ($script:localizedData.UnableToCompareProperty ` - -f $fieldName, $desiredType.Name) - - $returnValue = $false - } - } - } - } - } - } - } - - return $returnValue -} diff --git a/src/code/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 b/src/code/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 deleted file mode 100644 index 8e3522f..0000000 --- a/src/code/Modules/PowerShellGet.ResourceHelper/en-US/PowerShellGet.ResourceHelper.strings.psd1 +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright (c) Microsoft Corporation. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -# -# culture = "en-US" -ConvertFrom-StringData -StringData @' -###PSLOC - InValidUri = InValid Uri: '{0}'. A sample valid uri: https://www.powershellgallery.com/api/v2/. - PathDoesNotExist = Path: '{0}' does not exist. - VersionError = MinimumVersion should be less than the MaximumVersion. The MinimumVersion or MaximumVersion cannot be used with the RequiredVersion in the same command. - UnexpectedArgument = Unexpected argument type: '{0}'. - SourceNotFound = Source '{0}' not found. Please make sure you register it. - CallingFunction = Calling function '{0}'. - PropertyTypeInvalidForDesiredValues = Property 'DesiredValues' must be either a [System.Collections.Hashtable], [CimInstance] or [PSBoundParametersDictionary]. The type detected was {0}. - PropertyTypeInvalidForValuesToCheck = If 'DesiredValues' is a CimInstance, then property 'ValuesToCheck' must contain a value. - PropertyValidationError = Expected to find an array value for property {0} in the current values, but it was either not present or was null. This has caused the test method to return false. - PropertiesDoesNotMatch = Found an array for property {0} in the current values, but this array does not match the desired state. Details of the changes are below. - PropertyThatDoesNotMatch = {0} - {1} - ValueOfTypeDoesNotMatch = {0} value for property {1} does not match. Current state is '{2}' and desired state is '{3}'. - UnableToCompareProperty = Unable to compare property {0} as the type {1} is not handled by the Test-SQLDSCParameterState cmdlet. -###PSLOC -'@ diff --git a/src/code/PowerShellGetDSC.csproj b/src/code/PowerShellGetDSC.csproj deleted file mode 100644 index 682e625..0000000 --- a/src/code/PowerShellGetDSC.csproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Library - PowerShellGetDSC - PowerShellGetDSC - 1.0.0.0 - 1.0.0.0 - 1.0.0.0 - netstandard2.0 - 8.0 - - - - - - - From 7f396b2dc3d893695d37700125c19f5032931b81 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 10 Jan 2022 17:23:24 -0500 Subject: [PATCH 05/10] add other sections for CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f696af2..5c19922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,5 +2,11 @@ ## 1.0.0.0 +### Fixes + ### Changes As of the PowerShellGet 3.0.12-beta preview release, PowerShellGetDSC was separated into its own repository. This first version makes this PowerShellGetDSC repository available and complete with testing and building capabilities. + +### New Features + +### Notes From 5b70b5db22c05c021865b5ed20c5bb5066af90e6 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 10 Jan 2022 17:30:53 -0500 Subject: [PATCH 06/10] rename test to tests so pspackageproject wont try to run tests for non-module tests --- {test => tests}/Integration/MSFT_PSModule.Integration.Tests.ps1 | 0 {test => tests}/Integration/MSFT_PSModule.config.ps1 | 0 .../Integration/MSFT_PSRepository.Integration.Tests.ps1 | 0 {test => tests}/Integration/MSFT_PSRepository.config.ps1 | 0 {test => tests}/Unit/MSFT_PSModule.Tests.ps1 | 0 {test => tests}/Unit/MSFT_PSRepository.Tests.ps1 | 0 {test => tests}/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 | 0 {test => tests}/Unit/PowerShellGet.ResourceHelper.Tests.ps1 | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {test => tests}/Integration/MSFT_PSModule.Integration.Tests.ps1 (100%) rename {test => tests}/Integration/MSFT_PSModule.config.ps1 (100%) rename {test => tests}/Integration/MSFT_PSRepository.Integration.Tests.ps1 (100%) rename {test => tests}/Integration/MSFT_PSRepository.config.ps1 (100%) rename {test => tests}/Unit/MSFT_PSModule.Tests.ps1 (100%) rename {test => tests}/Unit/MSFT_PSRepository.Tests.ps1 (100%) rename {test => tests}/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 (100%) rename {test => tests}/Unit/PowerShellGet.ResourceHelper.Tests.ps1 (100%) diff --git a/test/Integration/MSFT_PSModule.Integration.Tests.ps1 b/tests/Integration/MSFT_PSModule.Integration.Tests.ps1 similarity index 100% rename from test/Integration/MSFT_PSModule.Integration.Tests.ps1 rename to tests/Integration/MSFT_PSModule.Integration.Tests.ps1 diff --git a/test/Integration/MSFT_PSModule.config.ps1 b/tests/Integration/MSFT_PSModule.config.ps1 similarity index 100% rename from test/Integration/MSFT_PSModule.config.ps1 rename to tests/Integration/MSFT_PSModule.config.ps1 diff --git a/test/Integration/MSFT_PSRepository.Integration.Tests.ps1 b/tests/Integration/MSFT_PSRepository.Integration.Tests.ps1 similarity index 100% rename from test/Integration/MSFT_PSRepository.Integration.Tests.ps1 rename to tests/Integration/MSFT_PSRepository.Integration.Tests.ps1 diff --git a/test/Integration/MSFT_PSRepository.config.ps1 b/tests/Integration/MSFT_PSRepository.config.ps1 similarity index 100% rename from test/Integration/MSFT_PSRepository.config.ps1 rename to tests/Integration/MSFT_PSRepository.config.ps1 diff --git a/test/Unit/MSFT_PSModule.Tests.ps1 b/tests/Unit/MSFT_PSModule.Tests.ps1 similarity index 100% rename from test/Unit/MSFT_PSModule.Tests.ps1 rename to tests/Unit/MSFT_PSModule.Tests.ps1 diff --git a/test/Unit/MSFT_PSRepository.Tests.ps1 b/tests/Unit/MSFT_PSRepository.Tests.ps1 similarity index 100% rename from test/Unit/MSFT_PSRepository.Tests.ps1 rename to tests/Unit/MSFT_PSRepository.Tests.ps1 diff --git a/test/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 b/tests/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 similarity index 100% rename from test/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 rename to tests/Unit/PowerShellGet.LocalizationHelper.Tests.ps1 diff --git a/test/Unit/PowerShellGet.ResourceHelper.Tests.ps1 b/tests/Unit/PowerShellGet.ResourceHelper.Tests.ps1 similarity index 100% rename from test/Unit/PowerShellGet.ResourceHelper.Tests.ps1 rename to tests/Unit/PowerShellGet.ResourceHelper.Tests.ps1 From 4192018845b139b425ff025c10fa35e83372df9a Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 10 Jan 2022 17:35:46 -0500 Subject: [PATCH 07/10] remove help --- doBuild.ps1 | 4 - help/Find-PSResource.md | 320 -- help/Get-PSResource.md | 153 - help/Get-PSResourceRepository.md | 102 - help/Install-PSResource.md | 325 -- help/PowerShellGet.md | 46 - help/Publish-PSResource.md | 175 - help/Register-PSResourceRepository.md | 232 -- help/Save-PSResource.md | 304 -- help/Set-PSResourceRepository.md | 200 -- help/Uninstall-PSResource.md | 142 - help/Unregister-PSResourceRepository.md | 131 - help/Update-PSResource.md | 284 -- help/en-US/PowerShellGet.dll-Help.xml | 4041 ----------------------- 14 files changed, 6459 deletions(-) delete mode 100644 help/Find-PSResource.md delete mode 100644 help/Get-PSResource.md delete mode 100644 help/Get-PSResourceRepository.md delete mode 100644 help/Install-PSResource.md delete mode 100644 help/PowerShellGet.md delete mode 100644 help/Publish-PSResource.md delete mode 100644 help/Register-PSResourceRepository.md delete mode 100644 help/Save-PSResource.md delete mode 100644 help/Set-PSResourceRepository.md delete mode 100644 help/Uninstall-PSResource.md delete mode 100644 help/Unregister-PSResourceRepository.md delete mode 100644 help/Update-PSResource.md delete mode 100644 help/en-US/PowerShellGet.dll-Help.xml diff --git a/doBuild.ps1 b/doBuild.ps1 index d07adf5..6565fc9 100644 --- a/doBuild.ps1 +++ b/doBuild.ps1 @@ -27,10 +27,6 @@ function DoBuild Write-Verbose -Verbose -Message "Copy-Item ${SrcPath}/DSCResources to '$BuildOutPath'" Copy-Item -Path "${SrcPath}/DSCResources" -Dest "$BuildOutPath" -Force -Recurse - # Copy help - Write-Verbose -Verbose -Message "Copying help files to '$BuildOutPath'" - Copy-Item -Path "${HelpPath}/${Culture}" -Dest "$BuildOutPath" -Recurse -Force - # Copy license Write-Verbose -Verbose -Message "Copying LICENSE file to '$BuildOutPath'" Copy-Item -Path "./LICENSE" -Dest "$BuildOutPath" diff --git a/help/Find-PSResource.md b/help/Find-PSResource.md deleted file mode 100644 index e2a9d33..0000000 --- a/help/Find-PSResource.md +++ /dev/null @@ -1,320 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Find-PSResource - -## SYNOPSIS -Searches for packages from a repository (local or remote), based on `-Name` and other package properties. - -## SYNTAX - -### ResourceNameParameterSet (Default) -``` PowerShell -[[-Name] ] [-Type ] [-Version ] [-Prerelease] [-Tag ] [-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -### CommandNameParameterSet -``` PowerShell -[[-CommandName] ] [-ModuleName ] [-Version ] [-Prerelease] [-Tag ] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -### DscResourceNameParameterSet -``` PowerShell -[[-DscResourceName] ] [-ModuleName ] [-Version ] [-Prerelease] [-Tag ] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -### TagParameterSet -``` PowerShell -[[-Name ][-Tag ] [-Prerelease] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -### TypeParameterSet -``` PowerShell -[[Name ] [-Prerelease] [-Type ] -[-Repository ] [-Credential ] [-IncludeDependencies] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The `Find-PSResource` cmdlet searches for a package from a repository (local or remote) based on `-Name` or other package properties. - -## EXAMPLES -These examples assume that the PSGallery repository is registered and contains the packages we are searching for. -### Example 1 -```powershell -PS C:\> Find-PSResource -Name "Microsoft.PowerShell.SecretManagement" -Repository PSGallery - Name Version Prerelease Description - ---- ------- ---------- ----------- - Microsoft.PowerShell.SecretManagement 1.0.0.0 This module ... -``` - -This examples searches for the package with `-Name` "Microsoft.PowerShell.SecretManagement". It returns the highest non-prerelease version for the package found by searching through the `-Repository` "PSGallery", which at the time of writing this example is version "1.0.0.0". - -### Example 2 -```powershell -PS C:\> Find-PSResource -Name "Microsoft.PowerShell.SecretManagement" -Repository PSGallery -Prerelease - Name Version Prerelease Description - ---- ------- ---------- ----------- - Microsoft.PowerShell.SecretManagement 1.1.0.0 preview2 This module ... -``` - -This examples searches for the package with `-Name` "Microsoft.PowerShell.SecretManagement". It returns the highest version (including considering prerelease versions) for the package found by searching through the specified `-Repository` "PSGallery", which at the time of writing this example is version "1.1.0-preview2". - -### Example 3 -```powershell -PS C:\> Find-PSResource -Name "Microsoft.PowerShell.SecretManagement" -Version "(0.9.0.0, 1.0.0.0]" -Repository PSGallery -Prerelease - Name Version Prerelease Description - ---- ------- ---------- ----------- - Microsoft.PowerShell.SecretManagement 0.9.1.0 This module ... - Microsoft.PowerShell.SecretManagement 1.0.0.0 This module ... -``` - -This examples searches for the package with `-Name` "Microsoft.PowerShell.SecretManagement". It returns all versions which satisfy the specified `-Version` range by looking through the specified `-Repository` "PSGallery". At the time of writing this example those satisfying versions are: "0.9.1.0" and "1.0.0.0". - -### Example 4 -```powershell -PS C:\> Find-PSResource -CommandName "Get-TargetResource" -Repository PSGallery - Name Version Prerelease ModuleName Repository - ---- ------- ---------- ---------- ---------- - Get-TargetResource 3.1.0.0 xPowerShellExecutionPolicy PSGallery - Get-TargetResource 1.0.0.4 WindowsDefender PSGallery - Get-TargetResource 1.2.0.0 SystemLocaleDsc PSGallery - Get-TargetResource 1.0.0.0 xInternetExplorerHomePage PSGallery - Get-TargetResource 4.0.1055.0 OctopusDSC PSGallery - Get-TargetResource 1.2.0.0 cRegFile PSGallery - Get-TargetResource 1.1.0.0 cWindowsErrorReporting PSGallery - Get-TargetResource 1.0.0.0 cVNIC PSGallery - Get-TargetResource 1.1.17.0 supVsts PSGallery - -``` - -This examples searches for all module resources with `-CommandName` "Get-TargetResource" from the `-Repository` PSGallery. It returns all the module resources which include a command named "Get-TargetResource" and also lists the following information for each module resource: version, name (displayed under ModuleName) and repository. To access the rest of the properties of the parent module resource, you can access the `$_.ParentResource` of the PSIncludedResourceInfo object returned from the CommandName parameter set. - -### Example 5 -```powershell -PS C:\> Find-PSResource -CommandName "Get-TargetResource" -ModuleName "SystemLocaleDsc" -Repository PSGallery - Name Version Prerelease ModuleName Repository - ---- ------- ---------- ---------- ---------- - Get-TargetResource 1.2.0.0 SystemLocaleDsc PSGallery -``` - -This examples searches for a module resource with a command named "Get-TargetResource" (via the `-CommandName` parameter), specifically from the module resource "SystemLocaleDsc" (via the `-ModuleName` parameter) from the `-Repository` PSGallery. The "SystemLocaleDsc" resource does indeed include a command named Get-TargetResource so this resource will be returned. The returned object lists the name of the command (displayed under Name) and the following information for the parent module resource: version, name (displayed under ModuleName) and repository. To access the rest of the properties of the parent module resource, you can access the `$_.ParentResource` of the PSIncludedResourceInfo object returned from the CommandName parameter set. - -### Example 6 -```powershell -PS C:\> Find-PSResource -DscResourceName "SystemLocale" -Repository PSGallery - Name Version Prerelease ModuleName Repository - ---- ------- ---------- ---------- ---------- - Get-TargetResource 8.5.0.0 ComputerManagementDsc PSGallery - Get-TargetResource 1.2.0.0 SystemLocaleDsc PSGallery - -``` - -This examples searches for all module resources with `-DscResourceName` "SystemLocale" from the `-Repository` PSGallery. It returns all the module resources which include a DSC resource named "SystemLocale" and also lists the following information for each module resource: version, name (displayed under ModuleName) and repository. To access the rest of the properties of the parent module resource, you can access the `$_.ParentResource` of the PSIncludedResourceInfo object returned from the DSCResourceName parameter set. - -## PARAMETERS - -### -Credential -Optional credentials to be used when accessing a repository. - -```yaml -Type: System.Management.Automation.PSCredential -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -IncludeDependencies -When specified, search will return all matched resources along with any resources the matched resources depends on. -Dependencies are deduplicated. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -Specifies a module resource package name type to search for. -Wildcards are supported. -Not yet implemented. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Name -Name of a resource or resources to find. -Accepts wild card character '*'. - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: True -``` - -### -Prerelease -When specified, includes prerelease versions in search results returned. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Repository -Specifies one or more repository names to search, which can include wildcard. -If not specified, search will include all currently registered repositories, in order of highest priority, until a repository is found that contains the package. - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: True -``` - -### -Tag -Filters search results for resources that include one or more of the specified tags. - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Type -Specifies one or more resource types to find. -Resource types supported are: Module, Script, Command, DscResource. - -```yaml -Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ResourceType[] -Parameter Sets: (All) -Aliases: -Accepted values: Module, Script, DscResource, Command - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Version -Specifies the version of the resource to be returned. The value can be an exact version or a version -range using the NuGet versioning syntax. - -For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) - -PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range -documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher -(minimum inclusive range). Instead, the values is considered as the required version and yields -version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as -the version range. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String[] - -## OUTPUTS - -### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo - -## NOTES - -## RELATED LINKS - -[]() diff --git a/help/Get-PSResource.md b/help/Get-PSResource.md deleted file mode 100644 index c7ccdb5..0000000 --- a/help/Get-PSResource.md +++ /dev/null @@ -1,153 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Get-PSResource - -## SYNOPSIS -Returns resources (modules and scripts) installed on the machine via PowerShellGet. - -## SYNTAX - -``` -Get-PSResource [[-Name] ] [-Version ] [-Path ] [] -``` - -## DESCRIPTION -The Get-PSResource cmdlet combines the Get-InstalledModule, Get-InstalledScript cmdlets from V2. It performs a search within module or script installation paths based on the -Name parameter argument. It returns PSResourceInfo objects which describes each resource item found. Other parameters allow the returned results to be filtered by version and path. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-PSResource Az -``` - -This will return versions of the Az module installed via PowerShellGet. - -### Example 2 -```powershell -PS C:\> Get-PSResource Az -version "1.0.0" -``` - -This will return version 1.0.0 of the Az module. - -### Example 3 -```powershell -PS C:\> Get-PSResource Az -version "(1.0.0, 3.0.0)" -``` - -This will return all versions of the Az module within the specified range. - -### Example 4 -```powershell -PS C:\> Get-PSResource Az -Path . -``` - -This will return all versions of the Az module that have been installed in the current directory. - -### Example 5 -```powershell -PS C:\> Get-PSResource -``` - -This will return all versions and scripts installed on the machine. - -## PARAMETERS - -### -Name -Name of a resource or resources to find. Accepts wild card characters or a null value. - -```yaml -Type: System.String[] -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: True -``` - -### -Path -Specifies the path to search in. - -```yaml -Type: System.String -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Version -Specifies the version of the resource to be returned. The value can be an exact version or a version -range using the NuGet versioning syntax. - -For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) - -PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range -documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher -(minimum inclusive range). Instead, the values is considered as the required version and yields -version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as -the version range. - -```yaml -Type: System.String -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## OUTPUTS - -### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo -``` -PSResourceInfo : { - AdditionalMetadata - Author - CompanyName - Copyright - Dependencies - Description - IconUri - Includes - InstalledDate - InstalledLocation - IsPrerelease - LicenseUri - Name - PackageManagementProvider - PowerShellGetFormatVersion - PrereleaseLabel - ProjectUri - PublishedDate - ReleaseNotes - Repository - RepositorySourceLocation - Tags - Type - UpdatedDate - Version -} -``` - -## NOTES - -## RELATED LINKS diff --git a/help/Get-PSResourceRepository.md b/help/Get-PSResourceRepository.md deleted file mode 100644 index 35c32e0..0000000 --- a/help/Get-PSResourceRepository.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Get-PSResourceRepository - -## SYNOPSIS -Finds and returns registered repository information. - -## SYNTAX - -``` -Get-PSResourceRepository [[-Name] ] [] -``` - -## DESCRIPTION -The Get-PSResourceRepository cmdlet searches for the PowerShell resource repositories that are registered on the machine. By default it will return all registered repositories, or if the `-Name` parameter argument is specified then it will return the repository which matches that name. It returns PSRepositoryInfo objects which contain information for each repository item found. - -## EXAMPLES - -### Example 1 -``` -PS C:\> Get-PSResourceRepository -Name "PSGallery" - Name Url Trusted Priority - ---- --- ------- -------- - PSGallery https://www.powershellgallery.com/api/v2 False 50 -``` - -This example runs the command with the 'Name' parameter being set to "PSGallery". This repository is registered on this machine so the command returns information on this repository. - -### Example 2 -``` -PS C:\> Get-PSResourceRepository -Name "*Gallery" - Name Url Trusted Priority - ---- --- ------- -------- - PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40 - PSGallery https://www.powershellgallery.com/api/v2 False 50 - -``` - -This example runs the command with the 'Name' parameter being set to "*Gallery" which includes a wildcard. The following repositories are registered on this machine and match the name pattern, so the command returns information on these repositories. - -### Example 3 -``` -PS C:\> Get-PSResourceRepository -Name "PSGallery","PoshTestGallery" - Name Url Trusted Priority - ---- --- ------- -------- - PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40 - PSGallery https://www.powershellgallery.com/api/v2 False 50 - -``` - -This example runs the command with the 'Name' parameter being set to an array of Strings. Both of the specified repositories are registered on this machine and match the name pattern, so the command returns information on these repositories. - -### Example 4 -``` -PS C:\> Get-PSResourceRepository -Name "*" - Name Url Trusted Priority - ---- --- ------- -------- - PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40 - PSGallery https://www.powershellgallery.com/api/v2 False 50 - psgettestlocal file:///c:/code/testdir True 50 - -``` - -This example runs the command with the 'Name' parameter being set to a single wildcard character. So all the repositories registered on this machine are returned. - -## PARAMETERS - -### -Name -This parameter takes a String argument, including wildcard characters, or an array of such String arguments. It is used to search for repository names from the repository store which match the provided name pattern. Tab completion is provided on this argument and will display registered repository names. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: True -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String[] - -## OUTPUTS - -### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo - -## NOTES -If no value for Name is provided, Get-PSResourceRepository will return information for all registered repositories. - -## RELATED LINKS diff --git a/help/Install-PSResource.md b/help/Install-PSResource.md deleted file mode 100644 index 8272e9f..0000000 --- a/help/Install-PSResource.md +++ /dev/null @@ -1,325 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Install-PSResource - -## SYNOPSIS -Installs resources (modules and scripts) from a registered repository onto the machine. - -## SYNTAX - -### NameParameterSet -``` -Install-PSResource [-Name] [-Version ] [-Prerelease] - [-Repository ] [-Credential ] [-Scope ] [-TrustRepository] - [-Reinstall] [-Quiet] [-AcceptLicense] [-NoClobber] [-SkipDependencyCheck] [-PassThru] [-WhatIf] [-Confirm] [] -``` - -### InputObjectParameterSet -``` -Install-PSResource [-InputObject ] [-Credential ] [-Scope ] [-TrustRepository] - [-Reinstall] [-Quiet] [-AcceptLicense] [-NoClobber] [-SkipDependencyCheck] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The Install-PSResource cmdlet combines the Install-Module and Install-Script cmdlets from V2. -It installs a resource from a registered repository to an installation path on a machine based on the -Name parameter argument. It does not return any object. Other parameters allow the resource to be specified by repository and version, and allow the user to suppress prompts or specify the scope of installation. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Install-PSResource Az -``` - -Installs the Az module. - -### Example 2 -```powershell -PS C:\> Install-PSResource Az -Version "[2.0.0, 3.0.0]" -``` - -Installs the latest stable Az module that is within the range 2.0.0 and 3.0.0. - -### Example 3 -```powershell -PS C:\> Install-PSResource Az -Repository PSGallery -``` - -Installs the latest stable Az module from the PowerShellGallery. - - -### Example 3 -```powershell -PS C:\> Install-PSResource Az -Reinstall -``` - -Installs the Az module and will write over any previously installed version if it is already installed. - -## PARAMETERS - -### -Name -Name of a resource or resources to install. Does not accept wildcard characters or a null value. - -```yaml -Type: System.String[] -Parameter Sets: NameParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -Version -Specifies the version of the resource to be installed. The value can be an exact version or a version -range using the NuGet versioning syntax. - -For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) - -PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range -documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher -(minimum inclusive range). Instead, the values is considered as the required version and yields -version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as -the version range. - -```yaml -Type: System.String -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Prerelease -When specified, includes prerelease versions in search results returned. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Repository -Specifies one or more repository names to search. -If not specified, search will include all currently registered repositories, in order of highest priority, until first repository package is found in. - -```yaml -Type: System.String[] -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Credential -Optional credentials to be used when accessing a repository. - -```yaml -Type: System.Management.Automation.PSCredential -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Scope -Specifies the scope under which a user has access. - -```yaml -Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ScopeType -Parameter Sets: (All) -Aliases: -Accepted values: CurrentUser, AllUsers - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -TrustRepository -Suppress prompts to trust repository. The prompt to trust repository only occurs if the repository is not already set to a trusted level. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Reinstall -Writes over any previously installed resource version that already exists on the machine. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Quiet -Supresses installation progress bar. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -AcceptLicense -Specifies that the resource should accept any request to accept license. This will suppress prompting if the module mandates that a user accept their license. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -NoClobber -Prevents installing a package that contains cmdlets that already exist on the machine. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SkipDependencyCheck -Skips the check for resource dependencies, so that only found resources are installed, and not any resources the found resource depends on. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -Passes the resource installed to the console. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Used for pipeline input. - -```yaml -Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## OUTPUTS -None - -## NOTES - -## RELATED LINKS \ No newline at end of file diff --git a/help/PowerShellGet.md b/help/PowerShellGet.md deleted file mode 100644 index 548aaf5..0000000 --- a/help/PowerShellGet.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -Module Name: PowerShellGet -Module Guid: 1d73a601-4a6c-43c5-ba3f-619b18bbb404 -Download Help Link: {{ Update Download Link }} -Help Version: {{ Please enter version of help manually (X.X.X.X) format }} -Locale: en-US ---- - -# PowerShellGet Module -## Description -{{ Fill in the Description }} - -## PowerShellGet Cmdlets -### [Find-PSResource](Find-PSResource.md) -{{ Fill in the Description }} - -### [Get-PSResource](Get-PSResource.md) -{{ Fill in the Description }} - -### [Get-PSResourceRepository](Get-PSResourceRepository.md) -{{ Fill in the Description }} - -### [Install-PSResource](Install-PSResource.md) -{{ Fill in the Description }} - -### [Publish-PSResource](Publish-PSResource.md) -{{ Fill in the Description }} - -### [Register-PSResourceRepository](Register-PSResourceRepository.md) -{{ Fill in the Description }} - -### [Save-PSResource](Save-PSResource.md) -{{ Fill in the Description }} - -### [Set-PSResourceRepository](Set-PSResourceRepository.md) -{{ Fill in the Description }} - -### [Uninstall-PSResource](Uninstall-PSResource.md) -{{ Fill in the Description }} - -### [Unregister-PSResourceRepository](Unregister-PSResourceRepository.md) -{{ Fill in the Description }} - -### [Update-PSResource](Update-PSResource.md) -{{ Fill in the Description }} - diff --git a/help/Publish-PSResource.md b/help/Publish-PSResource.md deleted file mode 100644 index 8c74c9d..0000000 --- a/help/Publish-PSResource.md +++ /dev/null @@ -1,175 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Publish-PSResource - -## SYNOPSIS -Publishes a specified module from the local computer to PSResource repository. - -## SYNTAX - -``` -Publish-PSResource [-APIKey ] [-Repository ] [-Path] [-DestinationPath] - [-Credential ] [-SkipDependenciesCheck] - [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The Publish-PSResource cmdlet combines the Publish-Module and Publish-Script cmdlets from V2. -It publishes a specified resource from the local computer to an online Nuget-based gallery by using an API key, stored as part of a user's profile in the gallery or to a local repository. -You can specify the resource to publish either by the resource's name, or by the path to the folder containing the module or script resource. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Publish-PSResource -Path c:\Test-Module -``` - -This will publish the module 'Test-Module' to the highest priority repository - -### Example 2 -```powershell -PS C:\> Publish-PSResource -Path c:\Test-Module -Repository PSGallery -APIKey '1234567' -``` - -This will publish the module 'Test-Module' to the PowerShellGallery. Note that the API key is a secret that is generated for a user from the website itself. - -## PARAMETERS - -### -APIKey -Specifies the API key that you want to use to publish a resource to the online gallery. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Repository -Specifies the repository to publish to. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Path -When specified, includes prerelease versions in search. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -DestinationPath -Specifies the path to where the resource (as a nupkg) should be saved to. This parameter can be used in conjunction with the -Repository parameter to publish to a repository and also save the exact same package to the local file system. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Credential -Specifies a user account that has rights to a specific repository (used for finding dependencies). - -```yaml -Type: System.Management.Automation.PSCredential -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SkipDependenciesCheck -Bypasses the default check that all dependencies are present on the repository which the resource is being published to. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - - -## OUTPUTS -None - -## NOTES - -## RELATED LINKS - diff --git a/help/Register-PSResourceRepository.md b/help/Register-PSResourceRepository.md deleted file mode 100644 index bf90cb3..0000000 --- a/help/Register-PSResourceRepository.md +++ /dev/null @@ -1,232 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Register-PSResourceRepository - -## SYNOPSIS -Registers a repository for PowerShell resources. - -## SYNTAX - -### NameParameterSet (Default) -``` -Register-PSResourceRepository [-Name] [-URL] [-Trusted] [-Priority ] [-PassThru] - [-WhatIf] [-Confirm] [] -``` - -### PSGalleryParameterSet -``` -Register-PSResourceRepository [-PSGallery] [-Trusted] [-Priority ] [-PassThru] [-WhatIf] [-Confirm] - [] -``` - -### RepositoriesParameterSet -``` -Register-PSResourceRepository -Repositories [-PassThru] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The Register-PSResourceRepository cmdlet registers a repository for PowerShell resources. - -## EXAMPLES -These examples assume that the repository we attempt to register is not already registered on the user's machine. -### Example 1 -``` -PS C:\> Register-PSResourceRepository -Name "PoshTestGallery" -URL "https://www.powershellgallery.com/api/v2" -PS C:\> Get-PSResourceRepository -Name "PoshTestGallery" - Name Url Trusted Priority - ---- --- ------- -------- - PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50 -``` - -This example registers the repository with the `-Name` of "PoshTestGallery" along with the associated `URL` value for it. - -### Example 2 -``` -PS C:\> Register-PSResourceRepository -PSGallery -PS C:\> Get-PSResourceRepository -Name "PSGallery" - Name Url Trusted Priority - ---- --- ------- -------- - PSGallery https://www.powershellgallery.com/api/v2 False 50 -``` - -This example registers the "PSGallery" repository, with the 'PSGallery' parameter. Unlike the previous example, we cannot use the `-Name` or `-URL` parameters to register the "PSGallery" repository as it is considered Powershell's default repository store and has its own value for URL. - -### Example 3 -``` -PS C:\> $arrayOfHashtables = @{Name = "psgettestlocal"; URL = "c:/code/testdir"},@{PSGallery = $True} -PS C:\> Register-PSResourceRepository -Repositories $arrayOfHashtables -PS C:\> Get-PSResourceRepository - Name Url Trusted Priority - ---- --- ------- -------- - PSGallery https://www.powershellgallery.com/api/v2 False 50 - psgettestlocal file:///c:/code/testdir False 50 - -``` - -This example registers multiple repositories at once. To do so, we use the `-Repositories` parameter and provide an array of hashtables. Each hashtable can only have keys associated with parameters for the NameParameterSet or the PSGalleryParameterSet. Upon running the command we can see that the "psgettestlocal" and "PSGallery" repositories have been succesfully registered. - -## PARAMETERS - -### -Name -Name of the repository to be registered. -Cannot be "PSGallery". - -```yaml -Type: String -Parameter Sets: NameParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Priority -Specifies the priority ranking of the repository. -Repositories with higher ranking priority are searched before a lower ranking priority one, when searching for a repository item across multiple registered repositories. Valid priority values range from 0 to 50, such that a lower numeric value (i.e 10) corresponds to a higher priority ranking than a higher numeric value (i.e 40). Has default value of 50. - -```yaml -Type: Int32 -Parameter Sets: NameParameterSet, PSGalleryParameterSet -Aliases: - -Required: False -Position: Named -Default value: 50 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PSGallery -When specified, registers PSGallery repository. - -```yaml -Type: SwitchParameter -Parameter Sets: PSGalleryParameterSet -Aliases: - -Required: True -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Repositories -Specifies an array of hashtables which contains repository information and is used to register multiple repositories at once. - -```yaml -Type: Hashtable[] -Parameter Sets: RepositoriesParameterSet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -Trusted -Specifies whether the repository should be trusted. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -URL -Specifies the location of the repository to be registered. -URL can be of the following Uri schemas: HTTPS, HTTP, FTP, file share based. - -```yaml -Type: String -Parameter Sets: NameParameterSet -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -When specified, displays the succcessfully registered repository and its information. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String - -## OUTPUTS - -### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter is used) - -## NOTES -Repositories are unique by 'Name'. Attempting to register a repository with same 'Name' as an already registered repository will not successfully register. - -Registering the PSGallery repository must be done via the PSGalleryParameterSet (i.e by using the 'PSGallery' parameter instead of 'Name' and 'URL' parameters). - -URL string input must be of one of the following Uri schemes: HTTP, HTTPS, FTP, File - -## RELATED LINKS diff --git a/help/Save-PSResource.md b/help/Save-PSResource.md deleted file mode 100644 index 8e9f667..0000000 --- a/help/Save-PSResource.md +++ /dev/null @@ -1,304 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Save-PSResource - -## SYNOPSIS -Saves resources (modules and scripts) from a registered repository onto the machine. - -## SYNTAX - -### NameParameterSet -``` -Save-PSResource [-Name] [-Version ] [-Prerelease] [-Repository ] - [-Credential ] [-AsNupkg] [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [] -``` - -### InputObjectParameterSet -``` -Save-PSResource [-InputObject] [-Credential ] [-AsNupkg] - [-IncludeXML] [-Path ] [-TrustRepository] [-SkipDependencyCheck] [-PassThru] [-Quiet] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The Save-PSResource cmdlet combines the Save-Module and Save-Script cmdlets from V2. -It saves a resource from a registered repository to a specific path on a machine based on the -Name parameter argument. It does not return any object. Other parameters allow the resource to be specified by repository and version, and allow the user to save the resource as a .nupkg or with the PowerShellGet XML metadata. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Save-PSResource -Name Az -``` -Saves the Az module - -### Example 2 -```powershell -PS C:\> Save-PSResource -Name Az -Repository PSGallery -``` -Saves the Az module found in the PowerShellGallery - -### Example 3 -```powershell -PS C:\> Save-PSResource Az -AsNupkg -``` -Saves the Az module as a .nupkg file - -### Example 4 -```powershell -PS C:\> Save-PSResource Az -IncludeXML -``` -Saves the Az module and includes the PowerShellGet XML metadata - -## PARAMETERS - -### -Name -Name of a resource or resources to save. Does not accept wildcard characters or a null value. - -```yaml -Type: System.String[] -Parameter Sets: NameParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -Version -Specifies the version of the resource to be saved. The value can be an exact version or a version -range using the NuGet versioning syntax. - -For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) - -PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range -documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher -(minimum inclusive range). Instead, the values is considered as the required version and yields -version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as -the version range. - -```yaml -Type: System.String -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Prerelease -Specifies to include prerelease versions. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Repository -Specifies one or more repository names to search. -If not specified, search will include all currently registered repositories, in order of highest priority, until first repository package is found in. - -```yaml -Type: System.String[] -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Credential -Optional credentials to be used when accessing a repository. - -```yaml -Type: System.Management.Automation.PSCredential -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -AsNupkg -Saves the resource as a zipped .nupkg file. -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -IncludeXML -Includes the PowerShellGet metadata XML (used to verify that PowerShellGet has installed a module). - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Path -Specifies the path to save the resource to. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -TrustRepository -Suppress prompts to trust repository. The prompt to trust repository only occurs if the repository is not already set to a trusted level. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -Passes the resource saved to the console. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SkipDependencyCheck -Skips the check for resource dependencies, so that only found resources are saved, and not any resources the found resource depends on. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Quiet -Supresses progress information. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Used for pipeline input. - -```yaml -Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -## OUTPUTS -None - -## NOTES - -## RELATED LINKS diff --git a/help/Set-PSResourceRepository.md b/help/Set-PSResourceRepository.md deleted file mode 100644 index b65cabe..0000000 --- a/help/Set-PSResourceRepository.md +++ /dev/null @@ -1,200 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Set-PSResourceRepository - -## SYNOPSIS -Sets information for a registered repository. - -## SYNTAX - -### NameParameterSet (Default) -``` -Set-PSResourceRepository [-Name] [-URL ] [-Trusted] [-Priority ] [-WhatIf] [-Confirm] [] -``` - -### RepositoriesParameterSet -``` -Set-PSResourceRepository -Repositories [-Priority ] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The Set-PSResourceRepository cmdlet sets information for a registered repository. - -## EXAMPLES -These examples are run independently of each other and assume the repositories used are already registered. The `-PassThru` parameter used with Set-PSResourceRepository is only used to display the changes made to the repository and is not mandatory. -### Example 1 -```powershell -PS C:\> Get-PSResourceRepository -Name "PoshTestGallery" - Name Url Trusted Priority - ---- --- ------- -------- - PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50 -PS C:\> Set-PSResourceRepository -Name "PoshTestGallery" -URL "c:/code/testdir" -PassThru - Name Url Trusted Priority - ---- --- ------- -------- - PoshTestGallery file:///c:/code/testdir False 50 -``` - -This example first checks if the PoshTestGallery repository has been registered. We wish to set the `-URL` value of this repository by running the Set-PSResourceRepository cmdlet with the `-URL` parameter and a valid Uri scheme url. We run the Get-PSResourceRepository cmdlet again to ensure that the `-URL` of the repository was changed. We also use the `-PassThru` parameter to see the changed repository. - -### Example 2 -```powershell -PS C:\> Get-PSResourceRepository -Name "PSGallery" - Name Url Trusted Priority - ---- --- ------- -------- - PSGallery https://www.powershellgallery.com/api/v2 False 50 -PS C:\> Set-PSResourceRepository -Name "PSGallery" -Priority 25 -Trusted -PassThru - Name Url Trusted Priority - ---- --- ------- -------- - PSGallery https://www.powershellgallery.com/api/v2 True 25 -``` - -This example first checks if the PSGallery repository has been registered. We wish to set the `-Priority` and `-Trusted` values of this repository by running the Set-PSResourceRepository cmdlet with the `-Priority` parameter set to a value between 0 and 50 and by using the `-Trusted` parameter switch. We run the Get-PSResourceRepository cmdlet again to ensure that the `-Priority` and `-Trusted` values of the repository were changed. An important note here is that just for the default PSGallery repository, the `-URL` value can't be changed/set. We also use the `-PassThru` parameter to see the changed repository. - -### Example 3 -```powershell -PS C:\> Get-PSResourceRepository -Name "*" - Name Url Trusted Priority - ---- --- ------- -------- - PSGallery https://www.powershellgallery.com/api/v2 False 50 - PoshTestGallery https://www.poshtestgallery.com/api/v2 False 50 - -PS C:\> $arrayOfHashtables = @{Name = "PSGallery"; Trusted = $True},@{Name = "PoshTestGallery"; URL = "c:/code/testdir"} - -PS C:\> Set-PSResourceRepository -Repositories $arrayOfHashtables -PassThru - Name Url Trusted Priority - ---- --- ------- -------- - PSGallery https://www.powershellgallery.com/api/v2 True 50 - PoshTestGallery file:///c:/code/testdir False 50 -``` - -This example first checks for all registered repositories. We wish to set the properties for multiple repositories at once (i.e the PSGallery and PoshTestGallery repositories), so we run Set-PSResourceRepository with the `-Repositories` parameter. This parameter takes an array of hashtables, where each hashtable contains information for a repository we wish to set information for. We also use the `-PassThru` parameter to see the changed repositories. - -## PARAMETERS - -### -Name -Specifies the name of the repository to be set. - -```yaml -Type: System.String -Parameter Sets: NameParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: False -``` - -### -Priority -Specifies the priority ranking of the repository, such that repositories with higher ranking priority are searched before a lower ranking priority one, when searching for a repository item across multiple registered repositories. Valid priority values range from 0 to 50, such that a lower numeric value (i.e 10) corresponds to a higher priority ranking than a higher numeric value (i.e 40). - -```yaml -Type: System.Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Trusted -Specifies whether the repository should be trusted. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -URL -Specifies the location of the repository to be set. - -```yaml -Type: String -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -When specified, displays the succcessfully registered repository and its information - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String - -### System.Collections.Hashtable[] - -## OUTPUTS - -### Microsoft.PowerShell.PowerShellGet.UtilClasses.PSRepositoryInfo (if 'PassThru' parameter used) - -## NOTES - -## RELATED LINKS diff --git a/help/Uninstall-PSResource.md b/help/Uninstall-PSResource.md deleted file mode 100644 index 6bfdef5..0000000 --- a/help/Uninstall-PSResource.md +++ /dev/null @@ -1,142 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Uninstall-PSResource - -## SYNOPSIS -Uninstalls a resource (module or script) that has been installed on the machine via PowerShellGet. - -## SYNTAX - -### NameParameterSet -``` -Uninstall-PSResource [-Name] [-Version ] [-SkipDependencyCheck] [-WhatIf] [] -``` - -### InputObjectParameterSet -``` -Uninstall-PSResource [-InputObject] [-SkipDependencyCheck] [-WhatIf] [] -``` - -## DESCRIPTION -The Uninstall-PSResource cmdlet combines the Uninstall-Module, Uninstall-Script cmdlets from V2. -It uninstalls a package found in a module or script installation path based on the -Name parameter argument. -It does not return an object. -Other parameters allow the returned results to be further filtered. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Uninstall-PSResource Az -``` - -Uninstalls the latest version of the Az module. - -### Example 2 -```powershell -PS C:\> Uninstall-PSResource -name Az -version "1.0.0" -``` - -Uninstalls version 1.0.0 of the Az module. - -### Example 3 -```powershell -PS C:\> Uninstall-PSResource -name Az -version "(1.0.0, 3.0.0)" - -Uninstalls all versions within the specified version range. -``` - -Uninstalls version 1.0.0 of the Az module. - -## PARAMETERS - -### -Name -Name of a resource or resources that has been installed. Accepts wild card characters. - -```yaml -Type: System.String[] -Parameter Sets: NameParameterSet -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByValue) -Accept wildcard characters: True -``` - -### -Version -Specifies the version of the resource to be uninstalled. - -```yaml -Type: System.String -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True -Accept wildcard characters: False -``` - -### -SkipDependencyCheck -Skips check to see if other resources are dependent on the resource being uninstalled. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Used for pipeline input. - -```yaml -Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.PSResourceInfo -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## OUTPUTS -None - -## NOTES - -## RELATED LINKS diff --git a/help/Unregister-PSResourceRepository.md b/help/Unregister-PSResourceRepository.md deleted file mode 100644 index 764a5eb..0000000 --- a/help/Unregister-PSResourceRepository.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Unregister-PSResourceRepository - -## SYNOPSIS -Un-registers a repository from the repository store. - -## SYNTAX - -### NameParameterSet -``` -Unregister-PSResourceRepository [-Name] [-PassThru][-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The Unregister-PSResourceRepository cmdlet unregisters a repository. - -## EXAMPLES - -### Example 1 -``` -PS C:\> Get-PSResourceRepository -Name "PoshTestGallery" -PS C:\> Unregister-PSResourceRepository -Name "PoshTestGallery" -PS C:\> Get-PSResourceRepository -Name "PoshTestGallery" -PS C:\> - -``` - -In this example, we assume the repository "PoshTestGallery" has been previously registered. So when we first run the command to find "PoshTestGallery" it verifies that this repository can be found. Next, we run the command to unregister "PoshTestGallery". Finally, we again run the command to find "PoshTestGallery" but since it was successfully un-registered it cannot be found or retrieved. - -### Example 2 -``` -PS C:\> Get-PSResourceRepository - Name Url Trusted Priority - ---- --- ------- -------- - PoshTestGallery https://www.poshtestgallery.com/api/v2 True 40 - PSGallery https://www.powershellgallery.com/api/v2 False 50 - psgettestlocal file:///c:/code/testdir True 50 - -PS C:\> Unregister-PSResourceRepository -Name "PoshTestGallery","psgettestlocal" -PS C:\> Get-PSResourceRepository - Name Url Trusted Priority - ---- --- ------- -------- - PSGallery https://www.powershellgallery.com/api/v2 False 50 - -``` - -In this example, the command to find all registered repositories is run and the repositories found are displayed. Next, the command to un-register is run with a list of names ("PoshTestGallery", "psgettestlocal") provided for the `-Name` parameter. Finally, the command to find all registered repositories is run again, but this time we can see that "PoshTestGallery" and "psgettestlocal" are not found and displayed as they have been successfully unregistered. - -## PARAMETERS - -### -Name -This parameter takes a String argument, or an array of String arguments. It is the name of the repository to un-register. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -PassThru -Passes the resource installed to the console. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String[] - -## OUTPUTS - -None - -## NOTES - -## RELATED LINKS diff --git a/help/Update-PSResource.md b/help/Update-PSResource.md deleted file mode 100644 index 167a606..0000000 --- a/help/Update-PSResource.md +++ /dev/null @@ -1,284 +0,0 @@ ---- -external help file: PowerShellGet.dll-Help.xml -Module Name: PowerShellGet -online version: -schema: 2.0.0 ---- - -# Update-PSResource - -## SYNOPSIS -Updates a package already installed on the user's machine. - -## SYNTAX - -### NameParameterSet (Default) -``` -Update-PSResource [-Name] [-Version ] [-Prerelease] [-Repository ] - [-Scope ] [-TrustRepository] [-Credential ] [-Quiet] [-AcceptLicense] [-Force] [-PassThru] [-SkipDependencyCheck] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The Update-PSResource cmdlet replaces the Update-Module and Update-Script cmdlets from V2. -It updates an already installed package based on the `-Name` parameter argument. -It does not return an object. Other parameters allow the package to be updated to be further filtered. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Update-PSResource -Name "TestModule" - Name Version Prerelease Description - ---- ------- ---------- ----------- - TestModule 1.2.0 test - -PS C:\> Update-PSResource -Name "TestModule" - -PS C:\> Update-PSResource -Name "TestModule" - Name Version Prerelease Description - ---- ------- ---------- ----------- - TestModule 1.3.0 test - TestModule 1.2.0 test - -``` - -In this example, the user already has the TestModule package installed and they update the package. Update-PSResource will install the latest version of the package without deleting the older version installed. - -## PARAMETERS - -### -AcceptLicense -For resources that require a license, AcceptLicense automatically accepts the license agreement during the update. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Credential -Specifies optional credentials to be used when accessing a private repository. - -```yaml -Type: System.Management.Automation.PSCredential -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Name -Specifies name of a resource or resources to update. - -```yaml -Type: System.String[] -Parameter Sets: NameParameterSet -Aliases: - -Required: True -Position: 0 -Default value: "*" -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: True -``` - -### -Prerelease -When specified, allows updating to a prerelease version. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Quiet -Supresses progress information. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Repository -Specifies one or more repository names to update packages from. -If not specified, search for packages to update will include all currently registered repositories in order of highest priority. - -```yaml -Type: System.String[] -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Scope -Specifies the scope of the resource to update. - -```yaml -Type: Microsoft.PowerShell.PowerShellGet.UtilClasses.ScopeType -Parameter Sets: (All) -Aliases: -Accepted values: CurrentUser, AllUsers - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -TrustRepository -Specifies optional credentials to be used when accessing a private repository. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Version -Specifies the version of the resource to be updated to. The value can be an exact version or a version -range using the NuGet versioning syntax. - -For more information about NuGet version ranges, see [Package versioning](/nuget/concepts/package-versioning#version-ranges) - -PowerShellGet supports all but the _minimum inclusive version_ listed in the NuGet version range -documentation. So inputting "1.0.0.0" as the version doesn't yield versions 1.0.0.0 and higher -(minimum inclusive range). Instead, the values is considered as the required version and yields -version 1.0.0.0 only (required version). To use the minimum inclusive range, provide `[1.0.0.0, ]` as -the version range. - -```yaml -Type: System.String -Parameter Sets: NameParameterSet -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Force -When specified, bypasses checks for TrustRepository and AcceptLicense and updates the package. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -Passes the resource updated to the console. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SkipdependencyCheck -Skips the check for resource dependencies, so that only found resources are updated, and not any resources the found resource depends on. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: System.Management.Automation.SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String[] - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[]() diff --git a/help/en-US/PowerShellGet.dll-Help.xml b/help/en-US/PowerShellGet.dll-Help.xml deleted file mode 100644 index 5e215e5..0000000 --- a/help/en-US/PowerShellGet.dll-Help.xml +++ /dev/null @@ -1,4041 +0,0 @@ -īģŋ - - - - Find-PSResource - Find - PSResource - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Find-PSResource - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - IncludeDependencies - - {{ Fill IncludeDependencies Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - ModuleName - - {{ Fill ModuleName Description }} - - System.String - - System.String - - - None - - - Prerelease - - {{ Fill Prerelease Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - Tags - - {{ Fill Tags Description }} - - System.String[] - - System.String[] - - - None - - - Type - - {{ Fill Type Description }} - - - Module - Script - DscResource - RoleCapability - Command - - System.String[] - - System.String[] - - - None - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - IncludeDependencies - - {{ Fill IncludeDependencies Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - ModuleName - - {{ Fill ModuleName Description }} - - System.String - - System.String - - - None - - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Prerelease - - {{ Fill Prerelease Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - Tags - - {{ Fill Tags Description }} - - System.String[] - - System.String[] - - - None - - - Type - - {{ Fill Type Description }} - - System.String[] - - System.String[] - - - None - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String[] - - - - - - - - System.String - - - - - - - - System.Management.Automation.PSCredential - - - - - - - - System.Management.Automation.SwitchParameter - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Get-PSResource - Get - PSResource - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Get-PSResource - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Path - - {{ Fill Path Description }} - - System.String - - System.String - - - None - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Path - - {{ Fill Path Description }} - - System.String - - System.String - - - None - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String[] - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Get-PSResourceRepository - Get - PSResourceRepository - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Get-PSResourceRepository - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String[] - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Install-PSResource - Install - PSResource - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Install-PSResource - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - AcceptLicense - - {{ Fill AcceptLicense Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - NoClobber - - {{ Fill NoClobber Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Prerelease - - {{ Fill Prerelease Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Quiet - - {{ Fill Quiet Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Reinstall - - {{ Fill Reinstall Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - Scope - - {{ Fill Scope Description }} - - - CurrentUser - AllUsers - - System.String - - System.String - - - None - - - TrustRepository - - {{ Fill TrustRepository Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Type - - {{ Fill Type Description }} - - System.String[] - - System.String[] - - - None - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Install-PSResource - - AcceptLicense - - {{ Fill AcceptLicense Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - NoClobber - - {{ Fill NoClobber Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Prerelease - - {{ Fill Prerelease Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Quiet - - {{ Fill Quiet Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Reinstall - - {{ Fill Reinstall Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - RequiredResourceFile - - {{ Fill RequiredResourceFile Description }} - - System.String - - System.String - - - None - - - Scope - - {{ Fill Scope Description }} - - - CurrentUser - AllUsers - - System.String - - System.String - - - None - - - TrustRepository - - {{ Fill TrustRepository Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Type - - {{ Fill Type Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Install-PSResource - - InputObject - - {{ Fill InputObject Description }} - - System.Object[] - - System.Object[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Install-PSResource - - RequiredResource - - {{ Fill RequiredResource Description }} - - System.Object - - System.Object - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - AcceptLicense - - {{ Fill AcceptLicense Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - InputObject - - {{ Fill InputObject Description }} - - System.Object[] - - System.Object[] - - - None - - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - NoClobber - - {{ Fill NoClobber Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Prerelease - - {{ Fill Prerelease Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Quiet - - {{ Fill Quiet Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Reinstall - - {{ Fill Reinstall Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - RequiredResource - - {{ Fill RequiredResource Description }} - - System.Object - - System.Object - - - None - - - RequiredResourceFile - - {{ Fill RequiredResourceFile Description }} - - System.String - - System.String - - - None - - - Scope - - {{ Fill Scope Description }} - - System.String - - System.String - - - None - - - TrustRepository - - {{ Fill TrustRepository Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Type - - {{ Fill Type Description }} - - System.String[] - - System.String[] - - - None - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String[] - - - - - - - - System.Object[] - - - - - - - - System.Management.Automation.PSCredential - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Publish-PSResource - Publish - PSResource - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Publish-PSResource - - Path - - {{ Fill Path Description }} - - System.String - - System.String - - - None - - - APIKey - - {{ Fill APIKey Description }} - - System.String - - System.String - - - None - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - DestinationPath - - {{ Fill DestinationPath Description }} - - System.String - - System.String - - - None - - - Exclude - - {{ Fill Exclude Description }} - - System.String[] - - System.String[] - - - None - - - IconUrl - - {{ Fill IconUrl Description }} - - System.String - - System.String - - - None - - - LicenseUrl - - {{ Fill LicenseUrl Description }} - - System.String - - System.String - - - None - - - Nuspec - - {{ Fill Nuspec Description }} - - System.String - - System.String - - - None - - - ProjectUrl - - {{ Fill ProjectUrl Description }} - - System.String - - System.String - - - None - - - ReleaseNotes - - {{ Fill ReleaseNotes Description }} - - System.String - - System.String - - - None - - - Repository - - {{ Fill Repository Description }} - - System.String - - System.String - - - None - - - SkipDependenciesCheck - - {{ Fill SkipDependenciesCheck Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Tags - - {{ Fill Tags Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Publish-PSResource - - APIKey - - {{ Fill APIKey Description }} - - System.String - - System.String - - - None - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - DestinationPath - - {{ Fill DestinationPath Description }} - - System.String - - System.String - - - None - - - Exclude - - {{ Fill Exclude Description }} - - System.String[] - - System.String[] - - - None - - - IconUrl - - {{ Fill IconUrl Description }} - - System.String - - System.String - - - None - - - LicenseUrl - - {{ Fill LicenseUrl Description }} - - System.String - - System.String - - - None - - - LiteralPath - - {{ Fill LiteralPath Description }} - - System.String - - System.String - - - None - - - Nuspec - - {{ Fill Nuspec Description }} - - System.String - - System.String - - - None - - - ProjectUrl - - {{ Fill ProjectUrl Description }} - - System.String - - System.String - - - None - - - ReleaseNotes - - {{ Fill ReleaseNotes Description }} - - System.String - - System.String - - - None - - - Repository - - {{ Fill Repository Description }} - - System.String - - System.String - - - None - - - SkipDependenciesCheck - - {{ Fill SkipDependenciesCheck Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Tags - - {{ Fill Tags Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Publish-PSResource - - APIKey - - {{ Fill APIKey Description }} - - System.String - - System.String - - - None - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - DestinationPath - - {{ Fill DestinationPath Description }} - - System.String - - System.String - - - None - - - Exclude - - {{ Fill Exclude Description }} - - System.String[] - - System.String[] - - - None - - - IconUrl - - {{ Fill IconUrl Description }} - - System.String - - System.String - - - None - - - LicenseUrl - - {{ Fill LicenseUrl Description }} - - System.String - - System.String - - - None - - - ProjectUrl - - {{ Fill ProjectUrl Description }} - - System.String - - System.String - - - None - - - ReleaseNotes - - {{ Fill ReleaseNotes Description }} - - System.String - - System.String - - - None - - - Repository - - {{ Fill Repository Description }} - - System.String - - System.String - - - None - - - SkipDependenciesCheck - - {{ Fill SkipDependenciesCheck Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Tags - - {{ Fill Tags Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Publish-PSResource - - APIKey - - {{ Fill APIKey Description }} - - System.String - - System.String - - - None - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - DestinationPath - - {{ Fill DestinationPath Description }} - - System.String - - System.String - - - None - - - Exclude - - {{ Fill Exclude Description }} - - System.String[] - - System.String[] - - - None - - - Nuspec - - {{ Fill Nuspec Description }} - - System.String - - System.String - - - None - - - Repository - - {{ Fill Repository Description }} - - System.String - - System.String - - - None - - - SkipDependenciesCheck - - {{ Fill SkipDependenciesCheck Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - APIKey - - {{ Fill APIKey Description }} - - System.String - - System.String - - - None - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - DestinationPath - - {{ Fill DestinationPath Description }} - - System.String - - System.String - - - None - - - Exclude - - {{ Fill Exclude Description }} - - System.String[] - - System.String[] - - - None - - - IconUrl - - {{ Fill IconUrl Description }} - - System.String - - System.String - - - None - - - LicenseUrl - - {{ Fill LicenseUrl Description }} - - System.String - - System.String - - - None - - - LiteralPath - - {{ Fill LiteralPath Description }} - - System.String - - System.String - - - None - - - Nuspec - - {{ Fill Nuspec Description }} - - System.String - - System.String - - - None - - - Path - - {{ Fill Path Description }} - - System.String - - System.String - - - None - - - ProjectUrl - - {{ Fill ProjectUrl Description }} - - System.String - - System.String - - - None - - - ReleaseNotes - - {{ Fill ReleaseNotes Description }} - - System.String - - System.String - - - None - - - Repository - - {{ Fill Repository Description }} - - System.String - - System.String - - - None - - - SkipDependenciesCheck - - {{ Fill SkipDependenciesCheck Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Tags - - {{ Fill Tags Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Register-PSResourceRepository - Register - PSResourceRepository - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Register-PSResourceRepository - - Name - - {{ Fill Name Description }} - - System.String - - System.String - - - None - - - URL - - {{ Fill URL Description }} - - System.Uri - - System.Uri - - - None - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Priority - - {{ Fill Priority Description }} - - System.Int32 - - System.Int32 - - - None - - - Proxy - - {{ Fill Proxy Description }} - - System.Uri - - System.Uri - - - None - - - ProxyCredential - - {{ Fill ProxyCredential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Trusted - - {{ Fill Trusted Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Register-PSResourceRepository - - Priority - - {{ Fill Priority Description }} - - System.Int32 - - System.Int32 - - - None - - - Proxy - - {{ Fill Proxy Description }} - - System.Uri - - System.Uri - - - None - - - ProxyCredential - - {{ Fill ProxyCredential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - PSGallery - - {{ Fill PSGallery Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Trusted - - {{ Fill Trusted Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Register-PSResourceRepository - - Proxy - - {{ Fill Proxy Description }} - - System.Uri - - System.Uri - - - None - - - ProxyCredential - - {{ Fill ProxyCredential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Repositories - - {{ Fill Repositories Description }} - - System.Collections.Generic.List`1[System.Collections.Hashtable] - - System.Collections.Generic.List`1[System.Collections.Hashtable] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Name - - {{ Fill Name Description }} - - System.String - - System.String - - - None - - - Priority - - {{ Fill Priority Description }} - - System.Int32 - - System.Int32 - - - None - - - Proxy - - {{ Fill Proxy Description }} - - System.Uri - - System.Uri - - - None - - - ProxyCredential - - {{ Fill ProxyCredential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - PSGallery - - {{ Fill PSGallery Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Repositories - - {{ Fill Repositories Description }} - - System.Collections.Generic.List`1[System.Collections.Hashtable] - - System.Collections.Generic.List`1[System.Collections.Hashtable] - - - None - - - Trusted - - {{ Fill Trusted Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - URL - - {{ Fill URL Description }} - - System.Uri - - System.Uri - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.Management.Automation.PSCredential - - - - - - - - System.Uri - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Save-PSResource - Save - PSResource - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Save-PSResource - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - AsNupkg - - {{ Fill AsNupkg Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - IncludeXML - - {{ Fill IncludeXML Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Path - - {{ Fill Path Description }} - - System.String - - System.String - - - None - - - Prerelease - - {{ Fill Prerelease Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - AsNupkg - - {{ Fill AsNupkg Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - IncludeXML - - {{ Fill IncludeXML Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Path - - {{ Fill Path Description }} - - System.String - - System.String - - - None - - - Prerelease - - {{ Fill Prerelease Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String[] - - - - - - - - System.Management.Automation.PSCredential - - - - - - - - System.String - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Set-PSResourceRepository - Set - PSResourceRepository - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Set-PSResourceRepository - - Name - - {{ Fill Name Description }} - - System.String - - System.String - - - None - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Priority - - {{ Fill Priority Description }} - - System.Int32 - - System.Int32 - - - None - - - Proxy - - {{ Fill Proxy Description }} - - System.Uri - - System.Uri - - - None - - - ProxyCredential - - {{ Fill ProxyCredential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Trusted - - {{ Fill Trusted Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - URL - - {{ Fill URL Description }} - - System.Uri - - System.Uri - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - Set-PSResourceRepository - - Priority - - {{ Fill Priority Description }} - - System.Int32 - - System.Int32 - - - None - - - Proxy - - {{ Fill Proxy Description }} - - System.Uri - - System.Uri - - - None - - - ProxyCredential - - {{ Fill ProxyCredential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Repositories - - {{ Fill Repositories Description }} - - System.Collections.Generic.List`1[System.Collections.Hashtable] - - System.Collections.Generic.List`1[System.Collections.Hashtable] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Name - - {{ Fill Name Description }} - - System.String - - System.String - - - None - - - Priority - - {{ Fill Priority Description }} - - System.Int32 - - System.Int32 - - - None - - - Proxy - - {{ Fill Proxy Description }} - - System.Uri - - System.Uri - - - None - - - ProxyCredential - - {{ Fill ProxyCredential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Repositories - - {{ Fill Repositories Description }} - - System.Collections.Generic.List`1[System.Collections.Hashtable] - - System.Collections.Generic.List`1[System.Collections.Hashtable] - - - None - - - Trusted - - {{ Fill Trusted Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - URL - - {{ Fill URL Description }} - - System.Uri - - System.Uri - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String - - - - - - - - System.Uri - - - - - - - - System.Management.Automation.PSCredential - - - - - - - - System.Collections.Generic.List`1[[System.Collections.Hashtable, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - - - - - - - - System.Int32 - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Uninstall-PSResource - Uninstall - PSResource - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Uninstall-PSResource - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Force - - {{ Fill Force Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - PrereleaseOnly - - {{ Fill PrereleaseOnly Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - Force - - {{ Fill Force Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - PrereleaseOnly - - {{ Fill PrereleaseOnly Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String[] - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Unregister-PSResourceRepository - Unregister - PSResourceRepository - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Unregister-PSResourceRepository - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String[] - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - - - Update-PSResource - Update - PSResource - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Update-PSResource - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - AcceptLicense - - {{ Fill AcceptLicense Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - NoClobber - - {{ Fill NoClobber Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Prerelease - - {{ Fill Prerelease Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Quiet - - {{ Fill Quiet Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - Scope - - {{ Fill Scope Description }} - - - CurrentUser - AllUsers - - System.String - - System.String - - - None - - - TrustRepository - - {{ Fill TrustRepository Description }} - - - System.Management.Automation.SwitchParameter - - - False - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - - System.Management.Automation.SwitchParameter - - - False - - - - - - AcceptLicense - - {{ Fill AcceptLicense Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Credential - - {{ Fill Credential Description }} - - System.Management.Automation.PSCredential - - System.Management.Automation.PSCredential - - - None - - - Name - - {{ Fill Name Description }} - - System.String[] - - System.String[] - - - None - - - NoClobber - - {{ Fill NoClobber Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Prerelease - - {{ Fill Prerelease Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Quiet - - {{ Fill Quiet Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Repository - - {{ Fill Repository Description }} - - System.String[] - - System.String[] - - - None - - - Scope - - {{ Fill Scope Description }} - - System.String - - System.String - - - None - - - TrustRepository - - {{ Fill TrustRepository Description }} - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - Version - - {{ Fill Version Description }} - - System.String - - System.String - - - None - - - Confirm - - Prompts you for confirmation before running the cmdlet. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - WhatIf - - Shows what would happen if the cmdlet runs. The cmdlet is not run. - - System.Management.Automation.SwitchParameter - - System.Management.Automation.SwitchParameter - - - False - - - - - - System.String[] - - - - - - - - System.Management.Automation.PSCredential - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - <add> - - - - - From 357c8faeb9838c8d94a2081245f43c998ec2230a Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 10 Jan 2022 17:37:08 -0500 Subject: [PATCH 08/10] remove duplicated .psd1 file --- DSC.psd1 | 63 -------------------------------------------------------- 1 file changed, 63 deletions(-) delete mode 100644 DSC.psd1 diff --git a/DSC.psd1 b/DSC.psd1 deleted file mode 100644 index 68c2113..0000000 --- a/DSC.psd1 +++ /dev/null @@ -1,63 +0,0 @@ -<# - This is a dummy PowerShell manifest file so that the DscResource.Tests - test framework recognize the module folder as correct (expected) folder - and file structure. - THIS FILE IS NOT USE DURING DEPLOYMENT. -#> -@{ - # Version number of this module. - moduleVersion = '1.0.0.0' - - # ID used to uniquely identify this module - GUID = 'e102ebd2-bdc3-4d0f-bc93-4b8cc3eb7074' - - # Author of this module - Author = 'Microsoft Corporation' - - # Company or vendor of this module - CompanyName = 'Microsoft Corporation' - - # Copyright statement for this module - Copyright = '(c) 2019 Microsoft Corporation. All rights reserved.' - - # Description of the functionality provided by this module - Description = 'Module with DSC Resources for deployment of PowerShell modules.' - - # Minimum version of the Windows PowerShell engine required by this module - PowerShellVersion = '5.0' - - # Minimum version of the common language runtime (CLR) required by this module - # CLRVersion = '4.0' - - # Functions to export from this module - FunctionsToExport = @() - - # Cmdlets to export from this module - CmdletsToExport = @() - - RequiredAssemblies = @() - - <# - Private data to pass to the module specified in RootModule/ModuleToProcess. - This may also contain a PSData hashtable with additional module metadata used by PowerShell. - #> - PrivateData = @{ - - PSData = @{ - - # Tags applied to this module. These help with module discovery in online galleries. - Tags = @('DesiredStateConfiguration', 'DSC', 'DSCResource') - - # A URL to the license for this module. - LicenseUri = 'https://github.com/PowerShell/PowerShellGet/blob/master/LICENSE' - - # A URL to the main website for this project. - ProjectUri = 'https://github.com/PowerShell/PowerShellGet' - - # ReleaseNotes of this module - ReleaseNotes = '' - - } # End of PSData hashtable - - } # End of PrivateData hashtable -} From f2331989da7080aa019c531fe249c09e836a4500 Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 10 Jan 2022 17:40:18 -0500 Subject: [PATCH 09/10] remove test.yml as tests dont run and nuget.config as we dont have binaries --- .ci/test.yml | 98 ---------------------------------------------------- nuget.config | 10 ------ 2 files changed, 108 deletions(-) delete mode 100644 .ci/test.yml delete mode 100644 nuget.config diff --git a/.ci/test.yml b/.ci/test.yml deleted file mode 100644 index aa14166..0000000 --- a/.ci/test.yml +++ /dev/null @@ -1,98 +0,0 @@ -parameters: - jobName: TestPkgWin - imageName: windows-latest - displayName: PowerShell Core on Windows - powershellExecutable: pwsh - -jobs: -- job: ${{ parameters.jobName }} - pool: - vmImage: ${{ parameters.imageName }} - displayName: ${{ parameters.displayName }} - steps: - - task: DownloadBuildArtifacts@0 - displayName: 'Download artifacts' - inputs: - buildType: current - downloadType: specific - itemPattern: '**/*.nupkg' - downloadPath: '$(System.ArtifactsDirectory)' - - - ${{ parameters.powershellExecutable }}: | - Get-ChildItem -Path "$(System.ArtifactsDirectory)" - displayName: Capture artifacts directory - - - ${{ parameters.powershellExecutable }}: | - $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' - if (Test-Path -Path $modulePath) { - Write-Verbose -Verbose "Deleting existing temp module path: $modulePath" - Remove-Item -Path $modulePath -Recurse -Force -ErrorAction Ignore - } - if (! (Test-Path -Path $modulePath)) { - Write-Verbose -Verbose "Creating new temp module path: $modulePath" - $null = New-Item -Path $modulePath -ItemType Directory - } - displayName: Create temporary module path - - - ${{ parameters.powershellExecutable }}: | - $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' - Write-Verbose -Verbose "Install PowerShellGet V3 to temp module path" - Save-Module -Name PowerShellGet -Path $modulePath -MinimumVersion 3.0.0-beta10 -AllowPrerelease -Force - Write-Verbose -Verbose "Install PlatyPS to temp module path" - Save-Module -Name "platyPS" -Path $modulePath -Force - Write-Verbose -Verbose "Install PSScriptAnalyzer to temp module path" - Save-Module -Name "PSScriptAnalyzer" -Path $modulePath -RequiredVersion 1.18.0 -Force - Write-Verbose -Verbose "Install Pester 4.X to temp module path" - Save-Module -Name "Pester" -MaximumVersion 4.99 -Path $modulePath -Force - Write-Verbose -Verbose "Install PSPackageProject to temp module path" - Save-Module -Name PSPackageProject -Path $modulePath -Force - displayName: Install PSPackageProject and dependencies - - - ${{ parameters.powershellExecutable }}: | - $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' - $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath - $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject - Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" - Import-Module -Name $modPath -Force - # - $sourceName = 'pspackageproject-local-repo' - Register-PackageSource -Name $sourceName -Location "$(System.ArtifactsDirectory)" -ProviderName PowerShellGet -Force -ErrorAction Ignore - Get-PackageSource -Name $sourceName - $config = Get-PSPackageProjectConfiguration - $buildOutputPath = $config.BuildOutputPath - Write-Verbose -Verbose -Message "PSPackage build output path: $buildOutputPath" - $null = New-Item -ItemType Directory -Path $buildOutputPath -Verbose - $moduleName = $config.ModuleName - Write-Verbose -Verbose "Saving package $sourceName to $($config.BuildOutputPath)" - Save-Package -Name $moduleName -Source $sourceName -ProviderName PowerShellGet -Path $config.BuildOutputPath -AllowPrereleaseVersions -Force - displayName: Extract product artifact - - - ${{ parameters.powershellExecutable }}: | - $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' - $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath - $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject - Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" - Import-Module -Name $modPath -Force - Get-Module - # - Invoke-PSPackageProjectTest -Type Functional - displayName: Execute functional tests - errorActionPreference: continue - - - ${{ parameters.powershellExecutable }}: | - $modulePath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'TempModules' - $env:PSModulePath = $modulePath + [System.IO.Path]::PathSeparator + $env:PSModulePath - $modPath = Join-Path -Path $modulePath -ChildPath PSPackageProject - Write-Verbose -Verbose "Importing PSPackageProject from: $modPath" - Import-Module -Name $modPath -Force - Get-Module - # - Invoke-PSPackageProjectTest -Type StaticAnalysis - displayName: Execute static analysis tests - errorActionPreference: continue - condition: succeededOrFailed() - - - ${{ parameters.powershellExecutable }}: | - Unregister-PSRepository -Name 'pspackageproject-local-repo' -ErrorAction Ignore - displayName: Unregister temporary PSRepository - condition: always() diff --git a/nuget.config b/nuget.config deleted file mode 100644 index 6548586..0000000 --- a/nuget.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - From d36c0cbb0102ac3120176bd115b450aea257883c Mon Sep 17 00:00:00 2001 From: Anam Navied Date: Mon, 10 Jan 2022 17:55:09 -0500 Subject: [PATCH 10/10] clean up git files to reference PowerShellGetDSC not PowerShellGet --- .github/ISSUE_TEMPLATE/Bug_Report.yaml | 3 ++- .github/ISSUE_TEMPLATE/config.yml | 2 +- .gitignore | 4 ---- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.yaml b/.github/ISSUE_TEMPLATE/Bug_Report.yaml index d7cc580..7d59d5e 100644 --- a/.github/ISSUE_TEMPLATE/Bug_Report.yaml +++ b/.github/ISSUE_TEMPLATE/Bug_Report.yaml @@ -9,8 +9,9 @@ body: [Feedback Hub app](https://support.microsoft.com/windows/send-feedback-to-microsoft-with-the-feedback-hub-app-f59187f8-8739-22d6-ba93-f66612949332) For PowerShellGet v2 issues, please use [PowerShellGetv2 repo](https://github.com/PowerShell/PowerShellGetv2). + For PowerShellGet v3 issues, please use [PowerShellGetv3 repo](https://github.com/PowerShell/PowerShellGet). - This repository is **ONLY** for PowerShellGet v3 issues. + This repository is **ONLY** for PowerShellGetDSC issues. - type: checkboxes attributes: label: Prerequisites diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 9fc4f30..1db417e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,4 +2,4 @@ blank_issues_enabled: false contact_links: - name: Documentation Issue url: https://github.com/MicrosoftDocs/PowerShell-Docs - about: Please open issues on documentation for PowerShellGet here. + about: Please open issues on documentation for PowerShellGetDSC here. diff --git a/.gitignore b/.gitignore index 557d7d4..1fcb152 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1 @@ -src/code/bin -src/code/obj -srcOld/code/bin -srcOld/code/obj out