$OSArchitecture = (Get-WmiObject -Class Win32_OperatingSystem | Select-Object    OSArchitecture -ErrorAction Stop).OSArchitecture
if($OSArchitecture -like '*64*'){
 #64bit system   
    $registryPath = "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319"
    $registryPath64bit = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319"
    $Registrykey = "SchUseStrongCrypto"
    $SchUseStrongCryptovalue = "1"
    If(!(Test-Path $registryPath)){
        New-Item -Path $registryPath -force | Out-Null
        New-ItemProperty -Path $registryPath -Name $Registrykey -Value $SchUseStrongCryptovalue -PropertyType DWord -Force | Out-Null
    } Else {
        New-ItemProperty -Path $registryPath -Name $Registrykey -Value $SchUseStrongCryptovalue -PropertyType DWord -Force | Out-Null
    }

    If(!(Test-Path $registryPath64bit)){
        New-Item -Path $registryPath64bit -force | Out-Null
        New-ItemProperty -Path $registryPath64bit -Name $Registrykey -Value $SchUseStrongCryptovalue -PropertyType DWord -Force | Out-Null
    } Else {
        New-ItemProperty -Path $registryPath64bit -Name $Registrykey -Value $SchUseStrongCryptovalue -PropertyType DWord -Force | Out-Null
    }
} else {
 #32bit system
    $registryPath = "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319"
    $Registrykey = "SchUseStrongCrypto"
    $SchUseStrongCryptovalue = "1"
    If(!(Test-Path $registryPath)){
        New-Item -Path $registryPath -force | Out-Null
        New-ItemProperty -Path $registryPath -Name $Registrykey -Value $SchUseStrongCryptovalue -PropertyType DWord -Force | Out-Null
    } Else {
        New-ItemProperty -Path $registryPath -Name $Registrykey -Value $SchUseStrongCryptovalue -PropertyType DWord -Force | Out-Null
    }
}
    
