I want the below environment variable to be queried in remote server if (($ImageName -like "devel") -or ($ImageName -like "hosted")) and I want to create a condition that if below variable with below variable value found on server then "ADE instalation is success" else " ADE instalation is failed"
variable name :ADE_INFRA
variable value : \\scavere01-zfs.us.oim.com\ade_infra
variable name :ADE_PACKAGES
variable value : \\scavere01-zfs.us.oim.com\packages\windows
I have created script like below, but the script dont give any output. I am not sure whether this is the correct methord to call and read system variables. Can any one help ?
if (($ImageName -like "*devel*") -or ($ImageName -like "*hosted*"))
{
$env= (gci env:*).GetEnumerator() | Sort-Object Name | Out-String
if (ADE_INFRA -eq "\\scavere01-zfs.us.oim.com\ade_infra" -And ADE_PACKAGES -eq "\\scavere01-zfs.us.oim.com\packages\windows")
{
$ADE = "ADE Installation Success"
echo "ADE = ADE Installation Success"
}
if (ADE_INFRA -eq $null -And ADE_PACKAGES -eq $null)
{
$ADE = "ADE Installation Failed"
echo "ADE = ADE Installation Failed"
}
}
Invoke-Commandandgci env: