Skip to content

Commit

Permalink
Use windows check that will account for Windows PS (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
anamnavi authored Sep 6, 2023
1 parent 6f187ca commit c57e8ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Microsoft.PowerShell.PSResourceGet.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ function Import-PSGetRepository {
# Use the -Force switch to overwrite existing repositories.
[switch]$Force
)
if ($IsWindows) {

$Runtime = [System.Runtime.InteropServices.RuntimeInformation]
$OSPlatform = [System.Runtime.InteropServices.OSPlatform]
# this checks for WindowsPwsh and Core
$IsOSWindows = $Runtime::IsOSPlatform($OSPlatform::Windows)
if ($IsOSWindows) {
$PSGetAppLocalPath = Microsoft.PowerShell.Management\Join-Path -Path $env:LOCALAPPDATA -ChildPath 'Microsoft\Windows\PowerShell\PowerShellGet\'
}
else {
Expand Down

0 comments on commit c57e8ba

Please sign in to comment.