diff --git a/sign.assembly.ps1 b/sign.assembly.ps1 index 2b58ece3..eecb4283 100644 --- a/sign.assembly.ps1 +++ b/sign.assembly.ps1 @@ -3,12 +3,12 @@ if ($env:CI -eq "true") { } $cert = Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1 -if ($cert -eq $null) { +if ($null -eq $cert) { Write-Host "No code signing certificate found in MY store. Exit." exit 1 } -$signtool = Get-ChildItem -Path "C:\Program Files (x86)\Windows Kits" -Recurse -Filter "signtool.exe" | Select-Object -First 1 -ExpandProperty FullName +$signtool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits" -Recurse -Filter "signtool.exe" | Select-Object -First 1 -ExpandProperty FullName Write-host "Signtool path: $signtool" if (Test-Path $signtool) { Write-Output "sign the assembly" diff --git a/sign3.ps1 b/sign3.ps1 index ca419390..17a9acc5 100644 --- a/sign3.ps1 +++ b/sign3.ps1 @@ -2,7 +2,7 @@ if ($env:CI -eq "true") { exit 0 } -$signtool = Get-ChildItem -Path "C:\Program Files (x86)\Windows Kits" -Recurse -Filter "signtool.exe" | Select-Object -First 1 -ExpandProperty FullName +$signtool = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits" -Recurse -Filter "signtool.exe" | Select-Object -First 1 -ExpandProperty FullName Write-host "Signtool path: $signtool" if (Test-Path $signtool) { New-Item -ItemType Directory -Path ".\SharpSnmpLib\bin\Release" -Force | Out-Null