mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 08:44:52 +02:00
detect add-type edge case with powershell 7 (#554)
This commit is contained in:
parent
af7130c91b
commit
1fa768f365
@ -95,7 +95,15 @@ public class AdjPriv
|
||||
}
|
||||
'@
|
||||
|
||||
$type = Add-Type $definition -PassThru -ErrorAction SilentlyContinue
|
||||
try
|
||||
{
|
||||
$type = Add-Type $definition -PassThru -ErrorAction SilentlyContinue
|
||||
}
|
||||
catch
|
||||
{
|
||||
# Powershell 7 does not add a type if it already exists
|
||||
$type = [AdjPriv]
|
||||
}
|
||||
|
||||
<#
|
||||
.Synopsis
|
||||
|
Loading…
x
Reference in New Issue
Block a user