PowerShell - Cross-Platform PowerShell
You wrote this PowerShell script to run only on Windows:
if ($IsWindows) {
Write-Output 'Windows detected'
} else {
Write-Output 'Not Windows'
}
But it always outputs 'Not Windows' even on Windows. What is the likely problem?