Export-CrescendoCommand
Creates JSON configuration files for Crescendo Command objects.
Sintassi
MultipleFile (impostazione predefinita).
Export-CrescendoCommand
[-command] <Command[]>
[-targetDirectory <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SingleFile
Export-CrescendoCommand
[-command] <Command[]>
-fileName <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Descrizione
This cmdlet creates JSON configuration files for Crescendo Command objects. It can create one JSON file per Command object or create one JSON file containing all objects passed to it.
Crescendo Command objects can be created using New-CrescendoCommand
or imported from an
existing configuration using Import-CommandConfiguration
.
This cmdlet was added in Microsoft.PowerShell.Crescendo v1.1.
Esempio
Example 1 - Create separate JSON files per command
In this example, Command objects are imported from an existing JSON configuration file.
Export-CrescendoCommand
is used to create separate JSON files for each cmdlet.
$config = Import-CommandConfiguration C:\projects\vssadmin\vssadmin.crescendo.config.json
Export-CrescendoCommand -command $config -targetDirectory .
Get-ChildItem
Directory: D:\temp\Crescendo
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 12/13/2022 3:24 PM 869 Get-VssProvider.crescendo.json
-a--- 12/13/2022 3:24 PM 3483 Get-VssShadow.crescendo.json
-a--- 12/13/2022 3:24 PM 2474 Get-VssShadowStorage.crescendo.json
-a--- 12/13/2022 3:24 PM 863 Get-VssVolume.crescendo.json
-a--- 12/13/2022 3:24 PM 860 Get-VssWriter.crescendo.json
-a--- 12/13/2022 3:24 PM 4973 Resize-VssShadowStorage.crescendo.json
Example 2 - Create a new JSON configuration file for existing commands
In this example, Command objects are imported from an existing JSON configuration file.
Export-CrescendoCommand
is used to create a new JSON configuration file containing all the
commands.
$config = Import-CommandConfiguration C:\projects\vssadmin\vssadmin.crescendo.config.json
Export-CrescendoCommand -command $config -fileName VssAdmin.crescendo.json
Get-ChildItem
Directory: D:\temp\Crescendo
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 12/13/2022 3:10 PM 15313 VssAdmin.crescendo.json
The new JSON file contains new properties for the current version of Crescendo and references the new schema URL. This is a convenient way to convert an old JSON configuration file to the new format.
Parametri
-command
One or more Crescendo Command objects to be exported.
Proprietà dei parametri
Tipo: | Command[] |
Valore predefinito: | None |
Supporta i caratteri jolly: | False |
DontShow: | False |
Set di parametri
(All)
Posizione: | 0 |
Obbligatorio: | True |
Valore dalla pipeline: | True |
Valore dalla pipeline in base al nome della proprietà: | False |
Valore dagli argomenti rimanenti: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Proprietà dei parametri
Tipo: | SwitchParameter |
Valore predefinito: | None |
Supporta i caratteri jolly: | False |
DontShow: | False |
Alias: | cf |
Set di parametri
(All)
Posizione: | Named |
Obbligatorio: | False |
Valore dalla pipeline: | False |
Valore dalla pipeline in base al nome della proprietà: | False |
Valore dagli argomenti rimanenti: | False |
-fileName
The name of the JSON file to create.
Proprietà dei parametri
Tipo: | String |
Valore predefinito: | None |
Supporta i caratteri jolly: | False |
DontShow: | False |
Set di parametri
SingleFile
Posizione: | Named |
Obbligatorio: | True |
Valore dalla pipeline: | False |
Valore dalla pipeline in base al nome della proprietà: | False |
Valore dagli argomenti rimanenti: | False |
-Force
Overwrite existing files.
Proprietà dei parametri
Tipo: | SwitchParameter |
Valore predefinito: | None |
Supporta i caratteri jolly: | False |
DontShow: | False |
Set di parametri
SingleFile
Posizione: | Named |
Obbligatorio: | False |
Valore dalla pipeline: | False |
Valore dalla pipeline in base al nome della proprietà: | False |
Valore dagli argomenti rimanenti: | False |
-targetDirectory
The output location for the JSON files created for each Command object.
Proprietà dei parametri
Tipo: | String |
Valore predefinito: | None |
Supporta i caratteri jolly: | False |
DontShow: | False |
Set di parametri
MultipleFile
Posizione: | Named |
Obbligatorio: | False |
Valore dalla pipeline: | False |
Valore dalla pipeline in base al nome della proprietà: | False |
Valore dagli argomenti rimanenti: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
Proprietà dei parametri
Tipo: | SwitchParameter |
Valore predefinito: | None |
Supporta i caratteri jolly: | False |
DontShow: | False |
Alias: | wi |
Set di parametri
(All)
Posizione: | Named |
Obbligatorio: | False |
Valore dalla pipeline: | False |
Valore dalla pipeline in base al nome della proprietà: | False |
Valore dagli argomenti rimanenti: | False |
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.