Skip to content

Commit c57e8ba

Browse files
authored
Use windows check that will account for Windows PS (#1390)
1 parent 6f187ca commit c57e8ba

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Microsoft.PowerShell.PSResourceGet.psm1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ function Import-PSGetRepository {
88
# Use the -Force switch to overwrite existing repositories.
99
[switch]$Force
1010
)
11-
if ($IsWindows) {
11+
12+
$Runtime = [System.Runtime.InteropServices.RuntimeInformation]
13+
$OSPlatform = [System.Runtime.InteropServices.OSPlatform]
14+
# this checks for WindowsPwsh and Core
15+
$IsOSWindows = $Runtime::IsOSPlatform($OSPlatform::Windows)
16+
if ($IsOSWindows) {
1217
$PSGetAppLocalPath = Microsoft.PowerShell.Management\Join-Path -Path $env:LOCALAPPDATA -ChildPath 'Microsoft\Windows\PowerShell\PowerShellGet\'
1318
}
1419
else {

0 commit comments

Comments
 (0)