Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline MRomer  
#1 Posted : Monday, August 12, 2019 8:11:01 PM(UTC)
MRomer

Rank: Paid support

Joined: 11/27/2012(UTC)
Posts: 50
United States
Location: Memphis, TN

Thanks: 8 times
Was thanked: 6 time(s) in 6 post(s)
I'm using a PowerShell task to execute a script stored on disk. The exact location of the script file is specified and the Working Folder is set to the script's location. lt The script completes and gives me the output it is supposed to, but VC shows this in the error log each time I run the task:
Quote:
Cannot bind argument to parameter 'Path' because it is null.
Exception in Task: Cannot bind argument to parameter 'Path' because it is null.

Any idea what I'm getting wrong?

Edited by moderator Wednesday, August 14, 2019 5:35:08 PM(UTC)  | Reason: Not specified

Offline Joey S  
#2 Posted : Monday, August 12, 2019 10:50:15 PM(UTC)
Joey S

Rank: Paid support

Joined: 3/26/2018(UTC)
Posts: 9
United States
Location: North Dakota, Grand Forks

Was thanked: 4 time(s) in 3 post(s)
Offline Support  
#3 Posted : Tuesday, August 13, 2019 12:04:00 PM(UTC)
Support

Rank: Official support

Joined: 12/1/2015(UTC)
Posts: 146

Thanks: 16 times
Was thanked: 6 time(s) in 5 post(s)
Originally Posted by: MRomer Go to Quoted Post
I'm using a PowerShell task to execute a script stored on disk. The exact location of the script file is specified and the Working Folder is set to the script's location. lt The script completes and gives me the output it is supposed to, but VC shows this in the error log each time I run the task:
Quote:
Cannot bind argument to parameter 'Path' because it is null.
Exception in Task: Cannot bind argument to parameter 'Path' because it is null.

Any idea what I'm getting wrong?


Like Joey S pointed out, could be something like that? It's something in your script that is the cause of this, not within VisualCron. Try to debug it within your script.
Michael
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline MRomer  
#4 Posted : Tuesday, August 13, 2019 4:46:56 PM(UTC)
MRomer

Rank: Paid support

Joined: 11/27/2012(UTC)
Posts: 50
United States
Location: Memphis, TN

Thanks: 8 times
Was thanked: 6 time(s) in 6 post(s)
Originally Posted by: Support Go to Quoted Post
Like Joey S pointed out, could be something like that? It's something in your script that is the cause of this, not within VisualCron. Try to debug it within your script.

The script in question does not invoke anything on a remote computer, and the script completes all of it's tasks as expected. It does not throw an error outside of the VisualCron PowerShell task. I do not get the error when running it manually, so I have nothing to debug.

I tried creating an Execute task that ran C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe, passing the script and its parameters with the -File argument. It still worked fine, and this time no error appeared in VisualCron.
Offline Support  
#5 Posted : Tuesday, August 13, 2019 4:55:13 PM(UTC)
Support

Rank: Official support

Joined: 12/1/2015(UTC)
Posts: 146

Thanks: 16 times
Was thanked: 6 time(s) in 5 post(s)
Originally Posted by: MRomer Go to Quoted Post
Originally Posted by: Support Go to Quoted Post
Like Joey S pointed out, could be something like that? It's something in your script that is the cause of this, not within VisualCron. Try to debug it within your script.

The script in question does not invoke anything on a remote computer, and the script completes all of it's tasks as expected. It does not throw an error outside of the VisualCron PowerShell task. I do not get the error when running it manually, so I have nothing to debug.

I tried creating an Execute task that ran C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe, passing the script and its parameters with the -File argument. It still worked fine, and this time no error appeared in VisualCron.


Can you export the task and send the script to support@visualcron.com so we can take a look and see if we can reproduce this?
Michael
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline MRomer  
#6 Posted : Tuesday, August 13, 2019 8:13:15 PM(UTC)
MRomer

Rank: Paid support

Joined: 11/27/2012(UTC)
Posts: 50
United States
Location: Memphis, TN

Thanks: 8 times
Was thanked: 6 time(s) in 6 post(s)
Originally Posted by: Support Go to Quoted Post
Can you export the task and send the script to support@visualcron.com so we can take a look and see if we can reproduce this?

Done. Thanks.
Offline Support  
#7 Posted : Wednesday, August 14, 2019 9:13:13 AM(UTC)
Support

Rank: Official support

Joined: 2/23/2008(UTC)
Posts: 11,167

Thanks: 866 times
Was thanked: 443 time(s) in 421 post(s)
Most likely the problem is this line:

Code:
Split-Path $script:MyInvocation.MyCommand.Path | Set-location 


This seems like a property that works in a shell cmd window. We do not use the shell for execution as we use the PowerShell host for execution (no cmd window is involved). I suggest you pass this as a parameter.
Henrik
Support
http://www.visualcron.com
Please like VisualCron on facebook!
thanks 1 user thanked Support for this useful post.
MRomer on 8/14/2019(UTC)
Offline MRomer  
#8 Posted : Wednesday, August 14, 2019 5:30:22 PM(UTC)
MRomer

Rank: Paid support

Joined: 11/27/2012(UTC)
Posts: 50
United States
Location: Memphis, TN

Thanks: 8 times
Was thanked: 6 time(s) in 6 post(s)
Originally Posted by: Support Go to Quoted Post
Most likely the problem is this line:

Code:
Split-Path $script:MyInvocation.MyCommand.Path | Set-location 


This seems like a property that works in a shell cmd window. We do not use the shell for execution as we use the PowerShell host for execution (no cmd window is involved). I suggest you pass this as a parameter.

That was it. I removed that line and the errors have stopped. Thank you.
thanks 1 user thanked MRomer for this useful post.
Support on 8/14/2019(UTC)
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top