$Host in Powershell – Cannot overwrite variable Host because it is read-only or constant.

By Andrei Ungureanu - Last updated: Friday, February 3, 2012 - Save & Share - Leave a Comment

Azi m-am uitat minute bune la eroarea Powershell “Cannot overwrite variable Host because it is read-only or constant.”

Codul arata cam asa:

ForEach ($Host in $Hosts)
{
}

Se pare ca $Host e rezervat in Powershell. Schimband in altceva mi-a rezolvat problema.

ForEach ($VMHost in $Hosts)
{
}

Nice …

Posted in Scripting • Tags: , Top Of Page

Write a comment