I'm calling from Visual Cron (7.0.8) using PowerShell option an PowerShell
script.
Script is correctly running from PowerShell IE on same machine and using same
credentials as Visual Cron does.
At time when I set-up Task in VC script had line like:
write-host -foregroundcolor greenRunning the task I got error like:
Exception in Task: Exception setting "ForegroundColor": "Cannot convert null to type "System.ConsoleColor" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The possible enumeration values are "Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White".". Cannot convert null to type "System.ConsoleColor" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The possible enumeration values are "Black, DarkBlue, DarkGreen, DarkCyan, DarkRed, DarkMagenta, DarkYellow, Gray, DarkGray, Blue, Green, Cyan, Red, Magenta, Yellow, White".I changed previous line into:
write-host -foregroundcolor [System.ConsoleColor]::GreenStill get SAME exception.
I deleted job/task and commented out that line , recreated job/task and same
error(
Exception in Task: Exception setting "ForegroundColor": "Cannot convert null to type "System.ConsoleColor" due to enumeration values that are not valid. Specify one of the following enumeration values and try again. The possible enumeration values are "Black, DarkBlue,....)
During debugging session I found one another issue : line write-host "Test line"
also kills task in VC 7.0.8 when using PowerShell execute method.
Is there any document that list PowerShell bad list of statements to be used?
Edited by user
2014-01-02T20:11:06Z
|
Reason: Not specified