$RegistryPath = 'HKEY_LOCAL_MACHINE:SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters' $Name = 'SMB1' $Value = '0'
If (-NOT (Test-Path $RegistryPath)) { New-Item -Path $RegistryPath -Force | Out-Null }
New-ItemProperty -Path $RegistryPath -Name $Name -Value $Value -PropertyType DWORD -Force