Hi All,

Busy working on a poc on Jenkins, so really new. So my question is as 
follows,

1. Running a "master" Powershell script to open a session and using 
invoke-command with the -File switch including the session

    $cred = New-Object System.Management.Automation.PSCredential 
-ArgumentList $User, $UserPassword

    $session = New-PSSession -ComputerName $ServerName -Credential $cred

    Invoke-Command -Session $session -FilePath 
C:\Development\Scripts\001_BaselineMountStorage.ps1 -ArgumentList 
$p1,$p2,$p3,$p4

Now I can output the environment variables from the "master" powershell 
script but get a blank when access them from the invoke-command powershell 
script (in this case 001_BaselineMountStorage.ps1)

How can i access the environment variables from within the invoked script? 
Could pass them as arguments, but what would happen if they are secret?



Regards,

Gavin

-- 
This email is sent by PwC. The email and any attachments may contain 
confidential and\or legally privileged material. You must not use or 
disclose the email if you are not the intended recipient. If you have 
received the email in error please let us know by contacting the sender and 
deleting the email. If this email contains a marketing message that you 
would prefer not to receive in the future please reply to the sender and 
copy your reply to privacy.offi...@au.pwc.com with "unsubscribe" in the 
subject line. Our liability is limited by a scheme approved under 
Professional Standards Legislation.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f6842500-5ecf-46a5-b4ce-fa9be33bb423%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to