mirror of
https://github.com/PowerShell/Win32-OpenSSH.git
synced 2025-10-28 02:03:55 +01:00
Adding in $PSScriptRoot allows this powershell script to be ran from anywhere. Before if you were not in the openssh directory in powershell it wouldn't be able to find ssh-lsa.dll Also switched the copy method to the powershell method of copying files.
11 lines
412 B
PowerShell
11 lines
412 B
PowerShell
Copy-Item -Path $PSScriptRoot\ssh-lsa.dll -Destination "$env:windir\system32"
|
|
$subkey = 'SYSTEM\CurrentControlSet\Control\Lsa'
|
|
$value = 'Authentication Packages'
|
|
$reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey('LocalMachine', 0)
|
|
$key = $reg.OpenSubKey($subkey, $true)
|
|
$arr = $key.GetValue($value)
|
|
if ($arr -notcontains 'ssh-lsa') {
|
|
$arr += 'ssh-lsa'
|
|
$key.SetValue($value, [string[]]$arr, 'MultiString')
|
|
}
|