|
17 | 17 | .NOTES |
18 | 18 | Author: Sam Erde (@SamErde) |
19 | 19 | Company: Sentinel Technologies, Inc |
20 | | - Version: 1.0.0 |
21 | | - Date: 2025-09-09 |
| 20 | + Version: 1.0.1 |
| 21 | + Date: 2025-09-10 |
22 | 22 |
|
23 | 23 | #> |
24 | 24 | [CmdletBinding()] |
|
102 | 102 | $InstalledModules = @() |
103 | 103 |
|
104 | 104 | if ($PSResourceGetInstalled) { |
105 | | - Write-Host "Using 'Save-PSResource' (Microsoft.PowerShell.PSResourceGet) to download modules.`n" -ForegroundColor White |
| 105 | + Write-Verbose "Using 'Save-PSResource' (Microsoft.PowerShell.PSResourceGet) to download modules.`n" |
106 | 106 | } else { |
107 | | - Write-Host "Using 'Save-Module' (PowerShellGet) to download modules.`n" -ForegroundColor White |
| 107 | + Write-Verbose "Using 'Save-Module' (PowerShellGet) to download modules.`n" |
108 | 108 | } |
109 | 109 |
|
110 | 110 | # Download the required modules into the DestinationPath. |
|
114 | 114 | $Prerelease = $Module.Prerelease |
115 | 115 |
|
116 | 116 | try { |
117 | | - Write-Host "Downloading module: $Name, Version: $Version, Prerelease: $Prerelease" -ForegroundColor Cyan |
| 117 | + Write-Host "Downloading module: $($("$Name $Version").Trim()) $(if ($Prerelease) {"(prerelease)"})" -ForegroundColor Cyan |
118 | 118 | if ($PSResourceGetInstalled) { |
119 | 119 | #try { |
120 | 120 | if ($Version) { |
|
142 | 142 | # Summary of downloaded modules. |
143 | 143 | if ($InstalledModules.Count -gt 0) { |
144 | 144 | Write-Host "`nDownloaded modules to $DestinationPath`n" |
145 | | - $InstalledModules | ForEach-Object -Process { Write-Host "`t$_" } -End "`n" |
| 145 | + $InstalledModules | ForEach-Object -Process { Write-Host "`t$_" } -End { Write-Host "`n" } |
146 | 146 | } else { |
147 | 147 | Write-Warning 'No modules were downloaded.' |
148 | 148 | } |
|
157 | 157 | Write-Verbose "Removed existing ZIP file: $ZipPath" |
158 | 158 | } |
159 | 159 | Compress-Archive -Path (Join-Path -Path $DestinationPath -ChildPath '*') -DestinationPath $ZipPath -Force |
160 | | - Write-Host "`nCreated ZIP file: $ZipPath" -ForegroundColor Green |
| 160 | + Write-Host "Created ZIP file: $ZipPath" -ForegroundColor Green |
161 | 161 | } catch { |
162 | 162 | Write-Error "Failed to create ZIP file: $ZipPath. Error: $_" |
163 | 163 | } |
|
0 commit comments