mirror of
https://github.com/aphrody-labs/NuGet.Client.git
synced 2026-10-14 13:29:05 +00:00
30 lines
881 B
PowerShell
30 lines
881 B
PowerShell
param ([switch] $skipNoOpMessage)
|
|
|
|
. "$PSScriptRoot\StrongNameVerification.ps1"
|
|
|
|
$verificationEnablements = Get-StrongNameVerificationEnablements
|
|
$isVerificationDisablementRequired = $verificationEnablements.GetEnumerator().Where({ $_.Value -eq $False }, 'First').Count -gt 0
|
|
|
|
If ($isVerificationDisablementRequired)
|
|
{
|
|
Write-Host "Strong name verification must be disabled for some assemblies."
|
|
|
|
If (Test-IsAdmin)
|
|
{
|
|
ForEach ($pair In $verificationEnablements.GetEnumerator())
|
|
{
|
|
If ($pair.Value -eq $False)
|
|
{
|
|
Disable-StrongNameVerification -regKey $pair.Name
|
|
}
|
|
}
|
|
}
|
|
Else
|
|
{
|
|
Execute-ScriptAsAdmin -scriptFilePath $MyInvocation.MyCommand.Definition
|
|
}
|
|
}
|
|
ElseIf (-Not $skipNoOpMessage)
|
|
{
|
|
Write-Host "Strong name verification is already disabled for required assemblies."
|
|
} |