Update StackMonkey.ps1
This commit is contained in:
@@ -102,7 +102,7 @@ Import-Module PowerShellGet -Force -ErrorAction SilentlyContinue
|
|||||||
$ProgressPreference = 'SilentlyContinue'
|
$ProgressPreference = 'SilentlyContinue'
|
||||||
$ConfirmPreference = 'None'
|
$ConfirmPreference = 'None'
|
||||||
|
|
||||||
# if NuGet isn’t already available, install it non-interactively
|
# if NuGet isn't already available, install it non-interactively
|
||||||
|
|
||||||
if (-not (Get-PackageProvider -Name NuGet -ListAvailable -ErrorAction SilentlyContinue)) {
|
if (-not (Get-PackageProvider -Name NuGet -ListAvailable -ErrorAction SilentlyContinue)) {
|
||||||
Install-PackageProvider `
|
Install-PackageProvider `
|
||||||
@@ -112,10 +112,10 @@ if (-not (Get-PackageProvider -Name NuGet -ListAvailable -ErrorAction SilentlyCo
|
|||||||
-Confirm:$false
|
-Confirm:$false
|
||||||
}
|
}
|
||||||
|
|
||||||
# import it so Register-PSRepository / Install-Module won’t prompt
|
# import it so Register-PSRepository / Install-Module won't prompt
|
||||||
Import-PackageProvider -Name NuGet -Force -ErrorAction SilentlyContinue
|
Import-PackageProvider -Name NuGet -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
# ensure PSGallery is trusted (so you don’t get “untrusted repository” prompt
|
# ensure PSGallery is trusted (so you don't get “untrusted repository” prompt
|
||||||
if ((Get-PSRepository -Name PSGallery -ErrorAction SilentlyContinue).InstallationPolicy -ne 'Trusted') {
|
if ((Get-PSRepository -Name PSGallery -ErrorAction SilentlyContinue).InstallationPolicy -ne 'Trusted') {
|
||||||
Set-PSRepository `
|
Set-PSRepository `
|
||||||
-Name PSGallery `
|
-Name PSGallery `
|
||||||
|
|||||||
Reference in New Issue
Block a user