I have a script created by VIRTU-AL: vCheck5.ps1
I have created a .bat file run fas a scheduled task. If I issue each command seperately, the script runs. But If I run the script together, it never gets by the first line:
powershell.exe
Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue
C:\PSscript\vCheck5.ps1 vi_server
I had no problem runniing this script from a Windows XP workstation. Now I have a Windows 7 (64-bit) workstation.
Any advice would be appreciated.
Note*
This was my previous script on a Windows XP workstation:
%SystemRoot%\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCLI\vim.psc1" -command "&{C:\PSscript\vCheck5.ps1 VI_Server}"
Here is the error message it returns:
Failed to load Windows PowerShell console file “C:\Program Files\VMware\Infrastr
ucture\vSphere PowerCLI\vim.psc1″. WIN 32 error: The system cannot find the path
specified.