When I am running "iisreset  /status" script in powershell command it gives me an error

geethushanthosh
Kilo Contributor

Error:

The term 'iisreset /status' 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.Stack Trace: at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandOrigin commandOrigin)at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)at System.Management.Automation.CommandFactory._CreateCommand(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)at System.Management.Automation.ExecutionContext.CreateCommand(String command)at System.Management.Automation.CommandNode.CreateCommandProcessor(Int32& index, ExecutionContext context)at System.Management.Automation.CommandNode.AddToPipeline(PipelineProcessor pipeline, ExecutionContext context)at System.Management.Automation.PipelineNode.Execute(Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)

1 ACCEPTED SOLUTION

try using this:



Invoke-Command -ComputerName ${workflow.scratchpad.hostname} -ScriptBlock {iisreset /status}


View solution in original post

7 REPLIES 7

larstange
Mega Sage

Can you show us the entire script used to run the PS?


workflow:



find_real_file.png


Powershell activity:


find_real_file.png


Don't you need to wrap that in an invoke-command statement?



iis - How to perform IISRESET with Powershell Script - Stack Overflow


Hi Johnny,



I have tried iisreset script in invoke command. Still I am getting the same error.