I’ve got a question. I’m a noob with powershell and I’m trying to restart (stop and later start) a webpage. In the local Powershell I run the "Stop-WebSite ‘’ " and it works. However when I try to run remotely with invoke-command it fails. Remoting is allowed on the IIS server. This is my command and the result I get:
Invoke-Command -Session $session -ScriptBlock $block -ArgumentList $siteName The term 'Stop-WebSite' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. + CategoryInfo : ObjectNotFound: (Stop-WebSite:String) , CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException + PSComputerName : us-mn-dc-iis-d1
I have IIS installed locally (so I have the PS Module). I’m on Win10, server is Win2008.