VMware Cloud Community
TGrissom
Contributor
Contributor

vRO Powershell Script Repo

I've been tinkering with running powershell scripts from vRO via a powershell host, and have a couple of questions on the matter:

1. It appears that script to be run on the powershell host cannot be a UNC path. Is this actually the case, or is there something I'm missing.

2. Are there any common ways that people typically host a repository of powershell scripts for vRO?

Reply
0 Kudos
5 Replies
SpasKaloferov
VMware Employee
VMware Employee

Hi,

mostly people either transform the scripts entirely into WF's or store the scripts as resource elements in vRO.

What do you mean by "it cannot be a UNC path" ?

If you mean that form the PSHost you will be accessing a share where your scripts lie, that doesn't matter as longs as you do it the right way.

Check this post out.

Using CredSSP with the vCO PowerShell Plugin (SKKB1002)

http://kaloferov.com/blog/using-credssp-with-the-vco-powershell-plugin/

BR,

Spas Kaloferov

(www.kaloferov.com/blog)

Reply
0 Kudos
TGrissom
Contributor
Contributor

I'm running a workflow which passes a script patch and args to a powershell host to be run. (Basically just a copy of the builtin Invoke an external script workflow.)

If I pass in a script path that is local on the powershell host such as C:\test.ps1 all is fine. If I pass in a UNC path, I get the following error:

[E] Error in (Dynamic Script Module name : invokeScript#14) PowerShellInvocationError: Errors found while executing script

System.Management.Automation.CommandNotFoundException: The term '\\UNC\path\here\test.ps1' 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.

More thoughts on the 2nd part of the question, I wonder if anyone has tried setting up of a DFS share on the powershell hosts so that the script path can be something local (D:\script.ps1), but managed remotely as a DFS share (\\pshosts\script.ps1).

Reply
0 Kudos
SpasKaloferov
VMware Employee
VMware Employee

You cannot directly call a UNC script like that and in addition this requires CredSSP. Check the example at the bottom of the link i provided above. You can use the Invoce-Command to do this.

BR,
Spas Kaloferov

(www.kaloferov.com/blog)

Reply
0 Kudos
TGrissom
Contributor
Contributor

I'm reading through the post now. Thank you.

I had thought that Kerberos would have allowed this behaviour. I'll do a bit more research on both Kerberos and CredSSP.

Reply
0 Kudos
SpasKaloferov
VMware Employee
VMware Employee

i acutely think this should work by just calling out the UNCPath\scriptname . I think i've tested it before and it worked.

But you still need to have Kerberos and CredSSP enabled.

Reply
0 Kudos