Save-HubContext

Synopsis

Save the current PSHubContext to a .json file at the path received

Syntax

Secure Password

Save-HubContext -Path <string> -SecurePassword [-PSHubContext <PSHubContext>] [-Force]
 [<CommonParameters>]

Password

Save-HubContext -Path <string> [-PSHubContext <PSHubContext>] [-Password <string>] [-Force]
 [<CommonParameters>]

Description

Save the current PSHubContext to a .json file at the path received. If PSHubContext is provided, save this one to a .sjon file. If Force is provided, overwrite file if the path already exist. If SecurePassword is provided, prompt to user to enter a password to encrypt the .json file. If Password provided, encrypt the .json file with the password received.

Examples

Example 1

PS C:\> Save-HubContext -Path "C:\PATH\TO\YOUR\FILE\file.json"

Save the current PSHubContext.

Example 2

PS C:\> Save-HubContext -Path "C:\PATH\TO\YOUR\FILE\file.json" -Password "password"

Save the current PSHubContext in a file protected by a password.

Example 3

PS C:\> $availCtxs = Get-HubContext; Save-HubContext -Path "C:\PATH\TO\YOUR\FILE\file.json" -PSHubContext $availCtxs[2] -SecurePassword

Fetch all available contexts. Save the third PSHubContext in a file protected by a password who will be filled be a prompt.

Parameters

-Force

Overwrite the file if exist

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Password

Will encrypt the file with the clear password

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Password
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Path

Specifies the path of the file to save Hub context.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-PSHubContext

Save Hub context to file.

Type: Devolutions.Hub.PowerShell.Entities.PowerShell.PSHubContext
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SecurePassword

Will prompt the password to encrypt the file with

Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Secure Password
  Position: Named
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Notes

For more information, type "Get-Help Save-HubContext -detailed". For technical information, type "Get-Help Save-HubContext -full".

Devolutions Forum logo Give us Feedback