We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44cab1a commit e536c32Copy full SHA for e536c32
Harden-Windows-Security.ps1
@@ -12,7 +12,7 @@ Function P {
12
13
if ($PSVersionTable.PSEdition -eq 'Desktop') {
14
15
- if (!(Get-Command -Name 'pwsh.exe')) {
+ if (!(Get-Command -Name 'pwsh.exe' -ErrorAction Ignore)) {
16
try {
17
Write-Verbose -Verbose -Message 'Trying to Install PowerShell Core using Winget because it could not be found' -Verbose
18
$null = Winget install 9MZ1SNWT0N5D --accept-package-agreements --accept-source-agreements
0 commit comments