Getting NativeCommandError while invoking Python script from Powershell!

Tags:
Powershell
Hi, I am trying to invoke the Python script from powershell. Am passing Python command, Python script path and parameter to the Python script as you can see below. When I am executing this, the Python script had been invoked and prcocessed as expected, but meanwhile am getting the below NativeCommandError from Powershell. The below output has the logs which are printed by Python the Python script. But along with that, Powershell had thrown the error. I just want to skip this error. However, the functinality wise there is no impact. Please suggest a way to skip this error. $param_data_path = 'D:Dinesh_Kumar' $pyscript_path = 'D:Dinesh_Kumarlog_rename.py' $python_cmd = 'D:ModelsModelScriptsProductionpython.cmd' cd $PSScriptRoot $cmd = "cmd.exe" $args = "/c $python_cmd $pyscript_path $param_data_path" &$cmd $args | Out-Null Output: (The output contains logs of Python script along with Powershell error.) cmd.exe : 05/09/19 03:33:27 - INFO - Renaming the log file process started! At D:Dinesh_KumarmyprojectInvoke-Python.ps1:12 char:1 + &$cmd $args | Out-Null + ~~~~~~~~~~~ + CategoryInfo : NotSpecified: (05/09/19 03:33:...rocess started!:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError 05/09/19 03:33:27 - INFO - Function rename_logs completed successfully! 05/09/19 03:33:27 - INFO - Renaming the log file process ended! Thanks, Dinesh_Kumar
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: