For *-PSSession cmdlets, add -InitializationScript ScriptBlock parameter - by Josh Gavant [MSFT]

Status : 

  Postponed<br /><br />
		Due to current priorities, the product team decided to postpone the resolution of this item.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


24
0
Sign in
to vote
ID 693031 Comments
Status Closed Workarounds
Type Suggestion Repros 0
Opened 10/4/2011 8:59:49 AM
Access Restriction Public

Description

When opening a new PSSession, whether via New-PSSession or Enter-PSSesion, or via implicit remoting with modules created by Import/Export-PSSession, it's often necessary to run an initialization script to add snapins or modules on the remote side. Start-Job has an -InitializationScript parameter for just such a scenario.

An -InitializationScript parameter should be added to all the *-PSSession cmdlets to allow adding initial functions, snapins, and modules to new sessions. It should also be added into Import/Export-PSSession as a custom ScriptBlock automatically run when a new internal PSSession is dynamically created by the exported module.
Sign in to post a comment.