Skip to main content

Get-LXCASwitchConfigFile

This cmdlet downloads (exports) one or more switch configuration-data files to the local system.

Note
You cannot pipe objects to this cmdlet.

Syntax

Get-LXCASwitchConfigFile [-Connection LXCAConnection] 
[-FileName String[]]
[-Destination String]
[-Overwrite]
[CommonParameter]

Parameters

-Connection LXCAConnection
Specifies the connection to the Lenovo XClarity Administrator server. If no connection is specified, the result from the last Connect-LXCA cmdlet is used.
-FileName String[]
Specifies the name of the configuration-data file.
-Destination String
Specifies the local directory where the file is to be saved.

If not specified, this cmdlet downloads a file named LXCAConfig_file.zip to the current PowerShell working directory.

-Overwrite
If specified, the cmdlet overwrites the local file when a file with that same name exists already.
CommonParameters
This cmdlet supports the following common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable, -OutBuffer, -PipelineVariable, -OutVariable. For detailed information about each common parameter, see the Microsoft PowerShell Common Parameters webpage.

Results

This cmdlet returns a string that contains the full name of the retrieved file.

Examples

The following example downloads a single configuration-data file to the default directory on the local system, and overwrites the file if it already exists.
$cred = Get-Credential
Connect-LXCA -Host 192.0.2.0 -Credential $cred

Get-LXCASwitchConfigFile -FileName Switch1.cfg -Overwrite

Disconnect-LXCA
The following example downloads all configuration-data files to the current PowerShell working directory on the local system.
$cred = Get-Credential
Connect-LXCA -Host "192.0.2.0" -Credential $Cred -SkipCertificateCheck
$configData = Get-LXCASwitchConfigData -ConfigData
$files = @()
foreach ($config in $configData)
{
$files += $config.FileName
}
$configFilesArchive = Get-LXCASwitchConfigFile -FileName $files
$configFilesArchive
Disconnect-LXCA