Skip to content

Commit efddbfe

Browse files
fixes and finetuning
1 parent 763281d commit efddbfe

6 files changed

Lines changed: 59 additions & 5 deletions

File tree

PSFramework.NuGet/changelog.md

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

3+
## ???
4+
5+
+ Upd: Updated to include PSResourceGet 1.1.0
6+
+ Upd: Get-PSFPowerShellGet - improved result display style
7+
+ Fix: Install-PSFModule - returns unexpected object when successfully installing, but not from the first priority repository
8+
+ Fix: Install-PSFModule - progress bar does not show number of deployments in progress.
9+
+ Fix: Scope: AllUsers - fails to install to AllUsers when no module has been installed there yet.
10+
311
## 0.9.2 (2025-01-17)
412

513
+ 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/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/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)