Skip to content

Restore-PSCredential

SYNOPSIS

Restores a PSCredential from a file.

SYNTAX

Restore-PSCredential [-UserName] <String> [[-Path] <String>] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DESCRIPTION

Takes in a UserName and restores a PSCredential from a file.

EXAMPLES

EXAMPLE 1

Restore-PSCredential -UserName "Admin"

This restores the PSCredential from the default location of $env:HOMEPATH.creds\Admin.cred

EXAMPLE 2

Restore-PSCredential -UserName "Admin" -Path "C:\Temp"

This restores the PSCredential from the location of C:\Temp\Admin.cred

PARAMETERS

-UserName

The username of the PSCredential

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Path

The folder path to restore the PSCredential from.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: "$env:HOMEPATH\.creds"
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{ Fill ProgressAction Description }}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

OUTPUTS

System.Management.Automation.PSCredential

NOTES