Skip to content

Commit

Permalink
Fix error installing nuget provider in SyncVirtualDesktops script
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0thyj committed Jul 27, 2024
1 parent a1f22ef commit 89e79de
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions experimental/SyncVirtualDesktops.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ $currentWinVer = (Get-CimInstance Win32_OperatingSystem).version
$settingsFile = "$((Get-Item $PSCommandPath).BaseName).dat"
$settingsUpdated = $false
if (-Not (Get-Module -ListAvailable -Name VirtualDesktop)) {
Install-PackageProvider -Name NuGet -Force -Scope CurrentUser
Install-Module -Name VirtualDesktop -Force -Scope CurrentUser
if (-Not (Get-PackageProvider -ListAvailable | Where-Object { $_.Name -eq "NuGet" })) {
Install-PackageProvider -Name NuGet -Force -Scope CurrentUser
}
Install-Module -Name VirtualDesktop -AllowClobber -Force -Scope CurrentUser
$settingsUpdated = $true
} elseif (-Not (Test-Path -Path $settingsFile -PathType Leaf) -Or ($currentWinVer -Ne (Import-Clixml -Path $settingsFile))) {
Update-Module -Name VirtualDesktop -Force
Expand Down

0 comments on commit 89e79de

Please sign in to comment.