Oh, I think I know what it might be. When not started in a truly local environment, the server to connect to has to be specified. I need to find the syntax for that and try it.
What you're likely running into is more of a 'what type of Host is Powershell running in' situation. PowerShell.exe is a ConsoleHost, where as the method VC is using to call powershell from that PowerShell task is via the API's and is not a console that can take input. There are certain commands you cannot run. Such as... try running "start-transcript" by itself, it's not allowed.
You'll likely need to do what I posted here, and run via PowerShell.exe instead of the PowerShell task. Which of course means you have to save a ps1 file with your code instead of within VC's task.
http://www.visualcron.co...ts&m=18454#post18454 EDIT: I just tried. I saved a PS1 file with nothing but your first line (dot sourced path to ps1) as the contents.
I ran it via an Execute task and i get this as the Output... which means it worked just fine. It's a Console thing.
Welcome to the Exchange Management Shell!
Full list of cmdlets: Get-Command
Only Exchange cmdlets: Get-ExCommand
Cmdlets that match a specific string: Help *<string>*
Get general help: Help
Get help for a cmdlet: Help <cmdlet name> or <cmdlet name> -?
Show quick reference guide: QuickRef
Exchange team blog: Get-ExBlog
Show full output for a command: <command> | Format-List
Tip of the day #65:
The special variable $_ represents the objects being passed from one cmdlet to another cmdlet in the pipeline. The $_ variable is automatically initiated by the Shell and is bound to the current pipeline object. You can access the properties of the object assigned to the $_ variable as you would any other object. The following example shows how you can view the Name property of each mailbox object that is passed through the pipeline:
Get-Mailbox | ForEach { $_.Name }
Brian
Edited by user
2014-05-21T16:12:28Z
|
Reason: Not specified