Hi, I have a question power shell problem.
I want to print file(C:\test_1.txt), so i used Invoke Power shell Activity and wrote to Commandtext like this :
“Start-Process -FilePath test_1.txt -WorkingDirectory C: -Verb Print”
but CommandNotFound Error occured.
Source: Invoke Power Shell (Throw)
Message: The term ‘Start-Process -FilePath test_1.txt -WorkingDirectory C:-Verb Print’ 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.
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Management.Automation.CommandNotFoundException: The term ‘Start-Process -FilePath test_1.txt -WorkingDirectory C:-Verb Print’ 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.
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
An ExceptionDetail, likely created by IncludeExceptionDetailInFaults=true, whose value is:
System.Management.Automation.CmdletInvocationException: This command cannot be run due to the error: The specified file could not be found. ----> System.InvalidOperationException: This command cannot be run due to the error: The specified file could not be found.
at System.Management.Automation.MshCommandRuntime.ThrowTerminatingError(ErrorRecord errorRecord)
— End of inner ExceptionDetail stack trace —
at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)