Skip to content

Commit fc8d920

Browse files
committed
🐛 Fix Default Windows Path going null and throwing an error on Linux
1 parent 499d3ff commit fc8d920

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ModuleFast.psm1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ function Install-ModuleFast {
272272
$Destination = Get-PSDefaultModulePath -AllUsers:($Scope -eq 'AllUsers')
273273

274274
#Special case for Windows to avoid the default installation path because it has issues with OneDrive
275-
$defaultWindowsModulePath = Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'PowerShell/Modules'
275+
$defaultWindowsModulePath = $isWindows ? (Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'PowerShell/Modules') : 'XXX___NOTSUPPORTED'
276+
276277
if ($IsWindows -and $Destination -eq $defaultWindowsModulePath -and $Scope -ne 'CurrentUser') {
277278
Write-Debug "Windows Documents module folder detected. Changing to $defaultRepoPath"
278279
$Destination = $defaultRepoPath

0 commit comments

Comments
 (0)