Skip to content

Commit e536c32

Browse files
committed
Update Harden-Windows-Security.ps1
1 parent 44cab1a commit e536c32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Harden-Windows-Security.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Function P {
1212

1313
if ($PSVersionTable.PSEdition -eq 'Desktop') {
1414

15-
if (!(Get-Command -Name 'pwsh.exe')) {
15+
if (!(Get-Command -Name 'pwsh.exe' -ErrorAction Ignore)) {
1616
try {
1717
Write-Verbose -Verbose -Message 'Trying to Install PowerShell Core using Winget because it could not be found' -Verbose
1818
$null = Winget install 9MZ1SNWT0N5D --accept-package-agreements --accept-source-agreements

0 commit comments

Comments
 (0)