Set-BluGenieSessionInfo
Set-BluGenieSessionInfo
SYNOPSIS
Set-BluGenieSessionInfo will set a Current Session Environment varialbe to be passed to each new PSSession Runspace automatically
SYNTAX
Set-BluGenieSessionInfo [[-CaptureVarName] <String>] [[-EnvVarName] <String>] [-Walkthrough] [<CommonParameters>]DESCRIPTION
Set-BluGenieSessionInfo will set a Current Session Environment varialbe to be passed to each new PSSession Runspace automatically.
All System variables will be removed once all Child and Parent sessions are closed.
EXAMPLES
EXAMPLE 1
Command: Set-BluGenieSessionInfoDescription: Capture the Default BluGenie Session variables in to an Environement variable named BGSessionInfo
Notes:EXAMPLE 2
Command: Set-BluGenieSessionInfo -CaptureVarName 'TestVar' -EnvVarName 'NewSesson'Description: Capture the Variable TestVar in to a System Variable named NewSession
Notes:EXAMPLE 3
Command: Set-SessionInfoDescription: Capture the Default BluGenie Session variables in to an Environement variable named BGSessionInfo
Notes:EXAMPLE 4
Command: Set-SessionInfo -CaptureVarName '^BG.*'Description: Capture all variables that start with BG in to an Environement variable named BGSessionInfo
Notes:EXAMPLE 5
Command: Set-SessionInfoStart-Job -Name 'Job1' -InitializationScript { Import-Module BluGenie; New-BluGenieSessionInfo } -ScriptBlock { Get-Module; Write-Host "`n`nTransDir = $TranscriptsDir" }
Receive-Job -Name 'Job1' -KeepDescription: Capture the default BluGenie session variables, Create a new job, and Initialize the variables in the new session.
Notes:EXAMPLE 6
Command: Set-BluGenieSessionInfo -HelpDescription: Call Help Information
Notes: If Help / WalkThrough is setup as a parameter, this script will be called to setup the Dynamic Help Menu if not the normal Get-Help will be called with the -Full parameterEXAMPLE 7
Command: Set-BluGenieSessionInfo -WalkThroughDescription: Call Help Information [2]
Notes: If Help / WalkThrough is setup as a parameter, this script will be called to setup the Dynamic Help Menu if not the normal Get-Help will be called with the -Full parameterPARAMETERS
CaptureVarName
-CaptureVarName <String>
Description: Define which Current Session variables will be captured into a Current System Variable
Notes: This String is parsed as RegEx.
The default values are as follows
BGMemory
BGNoBanner
BGNoExit
BGNoSetRes
BGRemoveMods
BGUpdateMods
ConsoleDebug
ConsoleJobTimeout
ConsolePrompt
ConsoleThreadCount
ConsoleTrap
CurTool
ErrTrap
LibVersion
ScriptBasename
ScriptDirectory
ScriptFullName
ToolsConfig
ToolsConfigFile
ToolsDirectory
TranscriptsDir
TranscriptsFile
Alias:
ValidateSet:
Required? false
Position? 1
Default value BGMemory|BGNoBanner|BGNoExit|BGNoSetRes|BGRemoveMods|BGUpdateMods|
ConsoleDebug|ConsoleJobTimeout|ConsolePrompt|ConsoleThreadCount|ConsoleTrap|CurTool|ErrTrap|LibVersion|ScriptBasename|
ScriptDirectory|ScriptFullName|ToolsConfig|ToolsConfigFile|ToolsDirectory|TranscriptsDir|TranscriptsFile|BGJSONJob
Accept pipeline input? false
Accept wildcard characters? falseEnvVarName
-EnvVarName <String>
Description: Name of the Current Systems Envinroment Variable
Notes: The default is 'BGSessionInfo'
Alias:
ValidateSet:
Required? false
Position? 2
Default value BGSessionInfo
Accept pipeline input? false
Accept wildcard characters? falseWalkthrough
-Walkthrough [<SwitchParameter>]
Description: Start the dynamic help menu system to help walk through the current command and all of the parameters
Notes:
Alias: Help
ValidateSet:
Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? falseCommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Last updated