Export-CrescendoCommand
Creates JSON configuration files for Crescendo Command objects.
Syntax
MultipleFile (Default)
Export-CrescendoCommand
[-command] <Command[]>
[-targetDirectory <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
SingleFile
Export-CrescendoCommand
[-command] <Command[]>
-fileName <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
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.
Examples
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.
Parameters
-command
One or more Crescendo Command objects to be exported.
Parameter properties
Type: | Command[] |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | 0 |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | cf |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-fileName
The name of the JSON file to create.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
SingleFile
Position: | Named |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Force
Overwrite existing files.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
SingleFile
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-targetDirectory
The output location for the JSON files created for each Command object.
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
MultipleFile
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | wi |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | 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.