You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ProfileLine="`$env:PSModulePath += '$([IO.Path]::PathSeparator +$Destination)' #Added by ModuleFast. DO NOT EDIT THIS LINE. If you do not want this, add -NoProfileUpdate to Install-ModuleFast."
1127
-
if ((Get-Content-Raw $myProfile) -notmatch [Regex]::Escape($ProfileLine)) {
1128
-
if (-not$PSCmdlet.ShouldProcess($myProfile,"Allow ModuleFast to work by adding $Destination to your PSModulePath on startup by appending to your CurrentUserAllHosts profile.")) {return }
1129
-
Write-Verbose"Adding $Destination to profile $myProfile"
1130
-
Add-Content-Path $myProfile-Value "`n`n"
1131
-
Add-Content-Path $myProfile-Value $ProfileLine
1132
-
} else {
1133
-
Write-Verbose"PSModulePath $Destination already in profile, skipping..."
1134
-
}
1129
+
if (-not (Test-Path$myProfile)) {
1130
+
if (-not$PSCmdlet.ShouldProcess($myProfile,"Allow ModuleFast to work by creating a profile at $myProfile.")) { return }
1131
+
Write-Verbose'User All Hosts profile not found, creating one.'
[string]$profileLine="if ('$destination' -notin (`$env:PSModulePath -split [Path]::PathSeparator)) {`$env:PSModulePath += `$([IO.Path]::PathSeparator + '$Destination') } #Added by ModuleFast. DO NOT EDIT THIS LINE. If you do not want this, add -NoProfileUpdate to Install-ModuleFast."
1136
+
if ((Get-Content-Raw $myProfile) -notmatch [Regex]::Escape($ProfileLine)) {
1137
+
if (-not$PSCmdlet.ShouldProcess($myProfile,"Allow ModuleFast to work by adding $Destination to your PSModulePath on startup by appending to your CurrentUserAllHosts profile.")) { return }
1138
+
Write-Verbose"Adding $Destination to profile $myProfile"
1139
+
Add-Content-Path $myProfile-Value "`n`n"
1140
+
Add-Content-Path $myProfile-Value $ProfileLine
1141
+
} else {
1142
+
Write-Verbose"PSModulePath $Destination already in profile, skipping..."
1135
1143
}
1136
1144
}
1137
1145
@@ -1142,7 +1150,8 @@ Searches local PSModulePath repositories
if ($Update-and$moduleSpec.Max-gt [ModuleFastSpec]::ParseVersion($versionMatch)) {
1246
+
Write-Debug"$moduleSpec`: Found a matching module version $versionMatch at $matchingManifest, but -Update was specified and the module spec allows for higher versions. Checking remote for updates..."
1247
+
return$null
1248
+
}
1249
+
1236
1250
if (-not [File]::Exists($matchingManifest)) {
1237
1251
throw"A matching module folder was found for $ModuleSpec but the manifest is not present at $matchingManifest. This is a bug and should never happen as we should have checked this ahead of time."
0 commit comments