Skip to content

Commit e24f300

Browse files
Merge pull request #3 from PowershellFrameworkCollective/development
0.9.11
2 parents b5e41af + 1eb4d3b commit e24f300

11 files changed

Lines changed: 181 additions & 9 deletions

File tree

PSFramework.NuGet/PSFramework.NuGet.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RootModule = 'PSFramework.NuGet.psm1'
44

55
# Version number of this module.
6-
ModuleVersion = '0.9.2'
6+
ModuleVersion = '0.9.11'
77

88
# ID used to uniquely identify this module
99
GUID = 'ad0f2a25-552f-4dd6-bd8e-5ddced2a5d88'

PSFramework.NuGet/changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 0.9.11 (2025-05-05)
4+
5+
+ New: Bootstrap script to deploy PSFramework.NuGet to the local computer without requiring Package Management.
6+
+ New: Module automatically deploys the NuGet provider to the user profile on module import, to simplify the PowerShellGet experience
7+
+ Upd: Updated to include PSResourceGet 1.1.0
8+
+ Upd: Get-PSFPowerShellGet - improved result display style
9+
+ Fix: Install-PSFModule - fails to detect already existing version of module and attempts to overwrite
10+
+ Fix: Install-PSFModule - returns unexpected object when successfully installing, but not from the first priority repository
11+
+ Fix: Install-PSFModule - progress bar does not show number of deployments in progress.
12+
+ Fix: Save-PSFModule - fails to detect already existing version of module and attempts to overwrite
13+
+ Fix: Scope: AllUsers - fails to install to AllUsers when no module has been installed there yet.
14+
315
## 0.9.2 (2025-01-17)
416

517
+ Fix: Get-PSFRepository - writes error when searching for a specific repository that only exists in one PSGet version

PSFramework.NuGet/functions/PowerShellGet/Get-PSFPowerShellGet.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151

5252
[PSCustomObject]@{
53-
PSTypeName = 'PSFramework.NuGet.GetReport'
53+
PSTypeName = 'PSFramework.NuGet.GetReport'
5454
ComputerName = $env:COMPUTERNAME
5555
V2 = ($modules | Where-Object { $_.Version.Major -lt 3 }) -as [bool]
5656
V3 = $modulesV3 -as [bool]

PSFramework.NuGet/internal/configurations/configuration.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ Set-PSFConfig -Module 'PSFramework.NuGet' -Name 'Import.IndividualFiles' -Value
1616

1717
Set-PSFConfig -Module 'PSFramework.NuGet' -Name 'Install.AuthenticodeSignature.Check' -Value $false -Initialize -Validation 'bool' -Description 'Whether on installation or download of module its code-signing will be checked first.'
1818
Set-PSFConfig -Module 'PSFramework.NuGet' -Name 'Remoting.DefaultConfiguration' -Value 'Microsoft.PowerShell' -Initialize -Validation string -Description 'The PSSessionConfiguration to use when initializing new PS remoting sessions'
19-
Set-PSFConfig -Module 'PSFramework.NuGet' -Name 'Remoting.Throttling' -Value 5 -Initialize -Validation integerpositive -Description 'Up to how many remote computers to deploy to in parallel.'
19+
Set-PSFConfig -Module 'PSFramework.NuGet' -Name 'Remoting.Throttling' -Value 5 -Initialize -Validation integerpositive -Description 'Up to how many remote computers to deploy to in parallel.'
20+
Set-PSFConfig -Module 'PSFramework.NuGet' -Name 'LocalBootstrap' -Value $true -Initialize -Validation bool -Description 'Whether PSGetV2 gets automatically bootstrapped on module import. This happens by default to improve user experience with an unmodified PowerShell that have never had to deal with PSGet. Also to simplify the experience in an offline environment.'

PSFramework.NuGet/internal/functions/Get/Publish-StagingModuleLocal.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@
5757
$publishCommon.Module = $module.Name
5858
$publishCommon.Version = $version.Name
5959

60-
$testPath = Join-Path -Path $destination.Path -ChildPath "$($module.Name)/$($version.Name)/$($module.DirectoryName).psd1"
60+
$testPath = Join-Path -Path $destination.Path -ChildPath "$($module.Name)/$($version.Name)/$($module.Name).psd1"
6161
$alreadyExists = Test-Path -Path $testPath
6262
if ($alreadyExists -and -not $Force) {
6363
Write-PSFMessage @msgParam -String 'Publish-StagingModule.Skipping.AlreadyExists' -StringValues $module.Name, $version.Name, $destination.Path
64+
New-PublishResult @publishCommon -Success $true -Message 'Module already deployed'
6465
continue
6566
}
6667

PSFramework.NuGet/internal/functions/Get/Publish-StagingModuleRemote.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
$PSDefaultParameterValues['Write-PSFMessage:ModuleName'] = 'PSFramework.NuGet'
6262
$PSDefaultParameterValues['Write-PSFMessage:FunctionName'] = 'Publish-StagingModule'
63+
$__PSF_Workflow.Data.InProgress[$TargetPath.ComputerName] = $true
6364

6465
#region Functions
6566
function Get-GlobalFailResult {

PSFramework.NuGet/internal/functions/Get/Save-StagingModule.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@
104104
if ($Repository.Credential) { $callSpecifics.Credential = $Repository.Credential }
105105

106106
$result = [PSCustomObject]@{
107+
PSTypeName = 'PSFramework.NuGet.DownloadResult'
107108
Success = $false
108109
Error = $null
109110
ModuleName = $Item.Name
@@ -203,8 +204,8 @@
203204
Write-PSFMessage -String 'Save-StagingModule.SavingV3.Start' -StringValues $Item.Name, $Item.Version, $Repository.Name, $Repository.Type -Target $Item
204205

205206
$callSpecifics = @{
206-
ErrorAction = 'Stop'
207-
Repository = $Repository.Name
207+
ErrorAction = 'Stop'
208+
Repository = $Repository.Name
208209
}
209210
if ((Get-Command Save-PSResource).Parameters.Keys -contains 'AcceptLicense') {
210211
$callSpecifics.AcceptLicense = $true
@@ -214,6 +215,7 @@
214215
if ($SkipDependency) { $callSpecifics.SkipDependencyCheck = $true }
215216

216217
$result = [PSCustomObject]@{
218+
PSTypeName = 'PSFramework.NuGet.DownloadResult'
217219
Success = $false
218220
Error = $null
219221
ModuleName = $Item.Name
@@ -282,7 +284,7 @@
282284
}
283285
}
284286
process {
285-
:item foreach ($installItem in $InstallData) {
287+
$null = :item foreach ($installItem in $InstallData) {
286288
$saveResults = foreach ($repository in $Repositories | Set-PSFObjectOrder -Property Priority, '>Type') {
287289
$saveResult = switch ($repository.Type) {
288290
V2 { Save-StagingModuleV2 -Repository $repository -Item $installItem @common }

PSFramework.NuGet/internal/moduleScopes/AllUsers.scope.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
return "$([Environment]::GetFolderPath("ProgramFiles"))\WindowsPowerShell\Modules"
44
}
55
if ($IsWindows) {
6-
return "$([Environment]::GetFolderPath("ProgramFiles"))\PowerShell\Modules"
6+
$path = "$([Environment]::GetFolderPath("ProgramFiles"))\PowerShell\Modules"
7+
if (-not (Test-Path -Path $path)) {
8+
$null = New-Item -Path $path -ItemType Directory -Force -ErrorAction Ignore
9+
}
10+
return $path
711
}
812
'/usr/local/share/powershell/Modules'
913
}

PSFramework.NuGet/internal/scripts/initialize.ps1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,15 @@
22
Search-PSFPowerShellGet
33

44
# Ensure all configured repositories exist, and all unintended repositories are gone
5-
Update-PSFRepository
5+
Update-PSFRepository
6+
7+
# Auto-Bootstrap Local GetV2 on Windows
8+
if (
9+
($PSVersionTable.PSVersion.Major -lt 5 -or $IsWindows) -and
10+
$env:LOCALAPPDATA -and
11+
(-not (Test-Path "$env:LOCALAPPDATA\PackageManagement\ProviderAssemblies\nuget\2.8.5.208\Microsoft.PackageManagement.NuGetProvider.dll")) -and
12+
(Get-PSFConfigValue -FullName 'PSFramework.NuGet.LocalBootstrap')
13+
) {
14+
$null = New-Item -Path "$env:LOCALAPPDATA\PackageManagement\ProviderAssemblies\nuget\2.8.5.208" -ItemType Directory -Force -ErrorAction SilentlyContinue
15+
Copy-Item -Path "$script:ModuleRoot\bin\Microsoft.PackageManagement.NuGetProvider.dll" -Destination "$env:LOCALAPPDATA\PackageManagement\ProviderAssemblies\nuget\2.8.5.208" -ErrorAction SilentlyContinue
16+
}

PSFramework.NuGet/xml/PSFramework.NuGet.Format.ps1xml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
<?xml version="1.0" encoding="utf-16"?>
22
<Configuration>
33
<ViewDefinitions>
4+
<!-- PSFramework.NuGet.GetReport -->
5+
<View>
6+
<Name>PSFramework.NuGet.GetReport</Name>
7+
<ViewSelectedBy>
8+
<TypeName>PSFramework.NuGet.GetReport</TypeName>
9+
</ViewSelectedBy>
10+
<TableControl>
11+
<AutoSize/>
12+
<TableHeaders>
13+
<TableColumnHeader/>
14+
<TableColumnHeader/>
15+
<TableColumnHeader/>
16+
<TableColumnHeader/>
17+
<TableColumnHeader/>
18+
</TableHeaders>
19+
<TableRowEntries>
20+
<TableRowEntry>
21+
<TableColumnItems>
22+
<TableColumnItem>
23+
<PropertyName>ComputerName</PropertyName>
24+
</TableColumnItem>
25+
<TableColumnItem>
26+
<PropertyName>V2</PropertyName>
27+
</TableColumnItem>
28+
<TableColumnItem>
29+
<PropertyName>V3</PropertyName>
30+
</TableColumnItem>
31+
<TableColumnItem>
32+
<PropertyName>V2CanInstall</PropertyName>
33+
</TableColumnItem>
34+
<TableColumnItem>
35+
<PropertyName>V2CanPublish</PropertyName>
36+
</TableColumnItem>
37+
</TableColumnItems>
38+
</TableRowEntry>
39+
</TableRowEntries>
40+
</TableControl>
41+
</View>
42+
443
<!-- PSFramework.NuGet.ModuleInfo -->
544
<View>
645
<Name>PSFramework.NuGet.ModuleInfo</Name>

0 commit comments

Comments
 (0)