Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


keithdavis
2018-02-20T17:26:44Z
We are trying to run a PowerShell script that exports Hyper-V virtual machines. This command works fine from the PowerShell command line:

c:\Users\keithdavis\Documents\Scripts\PowerShell\Hyper-V-Backup.ps1 -backupto J:\Hyper-VExports -sendto keithdavis@pridedallas.com -smtp mail.pridedallas.com -l J:\Hyper-VExports\Logs -from kdavis@pridedallas.com

But from VisualCron, we get this error:

ExecuteProcess("C:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 3336)->System.NotSupportedException: The given path's format is not supported.
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
ExecuteProcess("C:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 3336)->Unhandled execution error: System.NotSupportedException: The given path's format is not supported.
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
at xdAeNAel7N1GTOPbuG.wsmCLeFDjSxc0fvBRX.IcSMNBBOY(String[] )
Sponsor
Forum information
Support
2018-02-21T15:06:08Z
A logical drive is not recommended. Use a UNC path instead together with a Credential. (as logical drives are not shared between different environments)
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2018-02-21T18:18:00Z
What logical drive? You mean for hard drive attached to the computer? The J drive???

How would the drives connected to this machine not accessible? We use these drives throughout VisualCron for other tasks with no issues? Also, having to use a credential is something we avoid like the plague (too hard to maintain and keep secure).
keithdavis
2018-02-21T18:19:58Z
You are saying that this drive here is not accessible???
I have a very hard time believing that is the case.

Capture.PNG
Support
2018-02-21T19:29:39Z
Originally Posted by: keithdavis 

You are saying that this drive here is not accessible???
I have a very hard time believing that is the case.

Capture.PNG



I thought it was a logical mapped drive with that name.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Support
2018-02-21T19:30:50Z
One problem could be that you have your script on your own user path. Try moving it to another folder - it might be a permission problem for SYSTEM account to access that folder.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2018-02-23T21:13:54Z
I've got other scripts in this same location that work fine, but I'll try moving it to see what happens. Nope, same error, no matter where that script is stored.

OT: I am only intermittently getting notifications from this forum.
keithdavis
2018-02-23T21:26:14Z
If I remove all of the parameters and just run this:
c:\Users\keithdavis\Documents\Scripts\PowerShell\Hyper-V-Backup.ps1

I get this:
ExecuteProcess("C:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 3400)->System.Management.Automation.ParameterBindingException: Cannot process command because of one or more missing mandatory parameters: Backup.
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)

So it seems that it's having no trouble accessing the script. Could it be something with the command line formatting?
c:\Users\keithdavis\Documents\Scripts\PowerShell\Hyper-V-Backup.ps1 -backupto J:\Hyper-VExports -sendto keithdavis@pridedallas.com -smtp mail.pridedallas.com -l J:\Hyper-VExports\Logs -from kdavis@pridedallas.com
Support
2018-02-27T13:40:09Z
Originally Posted by: keithdavis 

If I remove all of the parameters and just run this:
c:\Users\keithdavis\Documents\Scripts\PowerShell\Hyper-V-Backup.ps1

I get this:
ExecuteProcess("C:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 3400)->System.Management.Automation.ParameterBindingException: Cannot process command because of one or more missing mandatory parameters: Backup.
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)

So it seems that it's having no trouble accessing the script. Could it be something with the command line formatting?
c:\Users\keithdavis\Documents\Scripts\PowerShell\Hyper-V-Backup.ps1 -backupto J:\Hyper-VExports -sendto keithdavis@pridedallas.com -smtp mail.pridedallas.com -l J:\Hyper-VExports\Logs -from kdavis@pridedallas.com



I think you originally got it right but try just to back to c:\ instead and see what error you get.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2018-02-27T16:40:39Z
If I change it this:
c:\Hyper-V-Backup.ps1 -backupto J:\Hyper-VExports -sendto keithdavis@pridedallas.com -smtp mail.pridedallas.com -l J:\Hyper-VExports\Logs -from kdavis@pridedallas.com

I get the original error:
ExecuteProcess("C:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 3450)->System.NotSupportedException: The given path's format is not supported.
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
ExecuteProcess("C:\Program Files (x86)\VisualCron\\PowerShell\TaskPowerShell.exe" 3450)->Unhandled execution error: System.NotSupportedException: The given path's format is not supported.
at TaskPowerShell.PowerShellTaskClass.Run(ProcessPowerShellTaskInfoClass ti, StringBuilder& sbStandardOut, StringBuilder& sbStandardError, Boolean& bolResult)
at xdAeNAel7N1GTOPbuG.wsmCLeFDjSxc0fvBRX.IcSMNBBOY(String[] )

keithdavis
2018-02-27T16:50:49Z
Are you certain that we can pass parameters to a PS script (file)? We don't have an example where we have done that before and I'm starting to think that is the problem.
keithdavis
2018-02-27T16:55:14Z
If put the actual PS script in the Task and specify the parameter values manually (set the variables manually), then the script works fine, but we really don't like doing that (no ability to track changes to the script).
keithdavis
2018-02-27T17:02:22Z
In fact, if I change the script to not need parameters at all, I can run the Job like this and it works fine:

c:\Users\keithdavis\Documents\Scripts\PowerShell\Hyper-V-Backup-KDAVIS.ps1

Seems to me that the PS execute file does not take parameters.
Support
2018-02-27T17:27:07Z
Originally Posted by: keithdavis 

In fact, if I change the script to not need parameters at all, I can run the Job like this and it works fine:

c:\Users\keithdavis\Documents\Scripts\PowerShell\Hyper-V-Backup-KDAVIS.ps1

Seems to me that the PS execute file does not take parameters.



Which Task are you using really? If you use the Execute Task you use parameters in the arguments field. If you use the PowerShell Task parameters are supplied other way.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2018-02-27T21:47:20Z
Support
2018-02-28T08:34:43Z
Originally Posted by: keithdavis 

What other way?




powershellparameters.png

The difference is that Execute uses PowerShell.exe command line interface with command line parameters while the PowerShell Task uses the PowerShell host. Parameters are then not supplied via command line but injected into host.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
keithdavis
2018-02-28T15:41:47Z
Ah, I didn't even know that Parameters dialog box existed.
Scroll to Top