Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,305 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
This morning one of my runbooks got an error.
What has happened? And can it be fixed?
Exception : System.Management.Automation.CommandNotFoundException: The term 'Out-String' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again. at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input) at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke) at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync) at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings) at Automation.Sandbox.Core.JobExecutor.PowerShell.TextStreamConverter.ConvertObjectToText(Object streamRecord) in C:\__w\1\s\src\Automation.Sandbox.Core\JobExecutor\PowerShellStreamProcessing\T extStreamConverter.cs:line 64
at Automation.Sandbox.Core.JobExecutor.PowerShell.PsStreamConverter.Convert[T](PSDataCollection`1 dataCollection, StreamType streamType) in C:\__w\1\s\src\Automation.Sandbox.Core\JobExecutor\Pow erShellStreamProcessing\PsStreamConverter.cs:line 39
at Automation.Sandbox.Core.JobExecutor.PowerShell.PowershellJobExecutor.HandleStreamDataAdded [T](StreamType streamType, JobProperties jobProperties, PSDataCollection`1 dataCollection, Boolean shouldSaveStream) in C:\__w\1\s\src\Automation.Sandbox.Core\JobExecutor\PowershellJobExecutor.cs:line 203 at Automation.Sandbox.Core.JobExecutor.PowerShell.PowershellJobExecutor.<>c__DisplayClass20_0 .<AttachJobStreamDataEventHandlers>b__2(Object sender, DataAddedEventArgs e) in C:\__w\1\s\src\Automation.Sandbox.Core\JobExecutor\PowershellJobExecutor.cs:line 183
at System.Management.Automation.PSDataCollection`1.RaiseEvents(Guid psInstanceId, Int32 index)
at System.Management.Automation.PSDataCollection`1.InternalAddRange(Guid psInstanceId, ICollection collection) at System.Management.Automation.Internal.PSDataCollectionStream`1.Write(Object obj, Boolean enumerateCollection) at System.Management.Automation.Internal.Pipe.AddToPipe(Object obj)
at System.Management.Automation.ExceptionHandlingOps.ReportErrorRecord(IScriptExtent extent, RuntimeException rte, ExecutionContext context)
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception) at verwerk-folder(Closure , FunctionContext )
at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) --- End of stack trace from previous location ---
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at verwerk-folder(Closure , FunctionContext ) TargetObject : Out-String CategoryInfo : ObjectNotFound: (Out-String:String) [], CommandNotFoundException FullyQualifiedErrorId : CommandNotFoundException ErrorDetails : InvocationInfo : System.Management.Automation.InvocationInfo ScriptStackTrace :
at verwerk-folder, <No file>: line 143
at verwerk-folder, <No file>: line 143
at verwerk-folder, <No file>: line 143
at verwerk-folder, <No file>: line 143
at verwerk-folder, <No file>: line 143
at verwerk-folder, <No file>: line 143
at verwerk-folder, <No file>: line 143
at verwerk-folder, <No file>: line 143
at verwerk-library, <No file>: line 87
at <ScriptBlock>, <No file>: line 584 PipelineIterationInfo : {} PSMessageDetails :
Hi @Peter van Rossum ,
I have tried to reproduce the issue, but I am able to successfully use the 'Out-String' cmdlet in my runbooks of different runtime versions. As per the error, 'Out-String' cmdlet is not recognized which means that either module containing the cmdlet is missing from the account, or there's a name conflict with a runbook name, or the cmdlet also exists in another module and Automation can't resolve the name.
To fix the issue, you can try the following solutions:
Get-Command <CommandName>
. After you've validated that the cmdlet is available to the account, and that there are no name conflicts with other cmdlets or runbooks, add the cmdlet to the canvas. Make sure that you're using a valid parameter set in your runbook.ModuleName\CmdletName
.