PowerShell - Cross-Platform PowerShell
Which of the following is the correct syntax to run a PowerShell script named
script.ps1 on macOS terminal?script.ps1 on macOS terminal?pwsh followed by the script name../script.ps1 tries to run the script directly, which may fail without execution permission and PowerShell context. powershell -file script.ps1 uses Windows syntax. run script.ps1 is invalid. pwsh script.ps1 correctly runs the script with PowerShell.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions