Is it really necessary to cross post in different forums at the same time?
https://social.technet.microsoft.com/Forums/en-US/746c91a9-6bea-412a-877b-6fa2bdf7ab87/powershell-script-works-in-isi-but-not-from-command-line?forum=winserverpowershell#bb2fb109-4cd9-4233-80e0-4aa05bb2471c