Hi,
I'm trying to run a task with a powershell script that interogates IIS to find the physical path of a virtual directory and write it to a file. When I run the script directly in powershell or right click on it and select "Run with powershell" the script runs correctly. However when I run the same script from within Visualcron, I get an error in the step with code 77777 and a stderr output of
"Exception in Task: Cannot find a provider with the name 'WebAdministration'. Cannot find a provider with the name 'WebAdministration'."
what can I do to fix this? the machine is a windows web server 2008 r2 (64 bit)
the powershell is very simple and contains the following
Import-Module WebAdministration
if (test-path c:\WebsiteLocations\CurrentUATOper8.loc)
{
Remove-Item c:\WebsiteLocations\CurrentUATOper8.loc
}
$CurrentUAT = (Get-WebFilePath "IIS:\Sites\UAT\Oper8").Name
New-Item -Path c:\WebsiteLocations -name CurrentUATOper8.loc -type "file" -value $CurrentUAT