Using the program here: http://www.codeproject.com/Articles/18409/Asynchronously-Execute-PowerShell-Scripts-from-C
I run into the error: Error in Script: System.Management.Automation.CmdletInvocationException: Cannot invoke this function because the current host does not implement it. ---> System.Management.Automation.Host.HostException: Cannot Invoke this function because the current host does not implement it.
When using a script I have in a local bin of one of our server, example by just typing in:
get-serverlist "property group" ServerRange | CollectPerfData.ps1*
If you execute script that requires interaction with the host process e.g. Write-Host, Read-Host then you have to implement the host interfaces. Take a look at this script for an example of how to do that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With