0

レジストリ キーから製品バージョンを取得しようとしています。コンソールに製品バージョンをエンド ユーザーに表示させたいところに少し行き詰まりました - 予期しないトークンを取得し続けています。

引用符などを移動しようとしましたが、それでも役に立ちません。

「if」を「$SEPVersion.ProductVersion -eq "11.0.5002.333") に変更する必要があると考えています - 変更しましたが、まだエラーが発生します。

どんな助けでも大歓迎です:

$SEPVersion = Get-ItemProperty 'HKLM:\SOFTWARE\Symantec\Symantec Endpoint Protection\SMC' -Name 'ProductVersion' | fl  ProductVersion -ErrorAction SilentlyContinue
if ($SEPVersion-eq "11.0.5002.333") {
    "SEP Version is correct the version is set to" $SEPVersion
}
else {
    "SEP Version is INCORRECT - Please resolve this - the version of SEP is " $SEPVersion }
4

1 に答える 1

1

これを試してください:

$SEPVersion = (Get-ItemProperty 'HKLM:\SOFTWARE\Symantec\Symantec Endpoint Protection\SMC' -Name 'ProductVersion' -ea SilentlyContinue ).Productversion     

if ($SEPVersion -eq "11.0.5002.333") 
{
    "SEP Version is correct the version is set to $SEPVersion"
}
else 
{
    "SEP Version is INCORRECT - Please resolve this - the version of SEP is $SEPVersion" 
}
于 2012-07-06T12:26:59.810 に答える