1.这是一个check要部署产品的服务器环境所用的脚本:
# ----------------------------------------------------------------
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
#
# Step 1: Check that Java has been installed
#
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# ----------------------------------------------------------------
Write-Host "************************************************************************";
Write-Host $([DateTime]::Now.ToString('yyyy-MM-dd hh:mm:ss.fff'))" Checking that Java has been installed...";
# Check: Has Java been installed?
$PathExists = Test-Path -path "HKLM:SOFTWARE\JavaSoft\Java Runtime Environment\1.6.*";
if ( $PathExists -ne $True )
{
Write-Host $([DateTime]::Now.ToString('yyyy-MM-dd hh:mm:ss.fff'))" Java has not been installed on this machine; exiting.";
Return 1;
}
Write-Host $([DateTime]::Now.ToString('yyyy-MM-dd hh:mm:ss.fff'))" Java has been installed.";
# ----------------------------------------------------------------
# vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
#
# Step 2: Check that JNBridge has been installed
#
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# ----------------------------------------------------------------
Write-Host "************************************************************************";
Write-Host $([DateTime]::Now.ToString('yyyy-MM-dd hh:mm:ss.fff'))" Checking that JNBridge has been installed...";
# Check: Has JNBridge been installed?
$PathExists = Test-Path -path "HKLM:SOFTWARE\JNBridge\JNBridgePro v6.0*";
if ( $PathExists -ne $True )
{
Write-Host $([DateTime]::Now.ToString('yyyy-MM-dd hh:mm:ss.fff'))" JNBridge has not been installed on this machine; exiting.";
Return 1;
}
Write-Host $([DateTime]::Now.ToString('yyyy-MM-dd hh:mm:ss.fff'))" JNBridge has been installed.";