# get the correct directory
$programPath = if ( (${env:ProgramFiles(x86)}).Length -eq 0) { ${env:ProgramFiles} } else { ${env:ProgramFiles(x86) } }
# create the path to add to the path variable
$pathToAdd = "$programPath\Java\jdk1.6.0_03\bin"
# get the current value for path
$currentPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
# create the new value for path
$newPath = "$currentPath;$pathToAdd"
# variant1: set the path with the registry provider
Set-ItemProperty -Path 'Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH –Value $newPath
# variant2: set the path with the .NET framework
[Environment]::SetEnvironmentVariable
( "Path", $newPath, [System.EnvironmentVariableTarget]::Machine )
selfssl /N "cn=localhost;cn=example.com" /V "EXPIRATIONTIMEINDAYS" /I /S "IISSITENAME" /X /F "KEYLOCATION\key.pfx" /W "PASSWORD" /T
makecert -r -n "CN=localhost" -b 01/01/2000 -e 01/01/2099 -eku 1.3.6.1.5.5.7.3.3 -sv localhost.pvk localhost.cer
cert2spc localhost.cer localhost.spc
pvk2pfx -pvk localhost.pvk -spc localhost.spc -pfx localhost.pfx
openssl genrsa -out localhost.key 2048
openssl req -new -x509 -key localhost.key -out localhost.cert -days 3650 -subj /CN=localhost