Powershell: Cannot overwrite variable Host because it is read-only or constant


While creating a Powershell script to pull statistic data from ESX hosts I ran into this error message:

Cannot overwrite variable Host because it is read-only or constant.
At line:16 char:8
+ foreach <<<< ($host in $ESXHosts)
    + CategoryInfo          : WriteError: (Host:String) [], SessionStateUnauthorizedAccessException
    + FullyQualifiedErrorId : VariableNotWritable

Apparently $Host is a reserved word / Variable in Powershell. Changing the variable name to $ESXHost solved the problem for me.


Fatal error: Uncaught Whoops\Exception\ErrorException: session_write_close(): write failed: No space left on device (28) in Unknown:0 Stack trace: #0 /var/www/html/system/src/Grav/Common/Debugger.php(847): Whoops\Run->handleError(2, 'session_write_c...', 'Unknown', 0) #1 [internal function]: Grav\Common\Debugger->deprecatedErrorHandler(2, 'session_write_c...', 'Unknown', 0, NULL) #2 [internal function]: session_write_close() #3 {main} thrown in Unknown on line 0