Export-CrescendoCommand
Creates JSON configuration files for Crescendo Command objects.
Syntax
Export-CrescendoCommand
[-command] <Command[]>
[-targetDirectory <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
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.
Type: | Command[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-fileName
The name of the JSON file to create.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Overwrite existing files.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-targetDirectory
The output location for the JSON files created for each Command object.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet isn't run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Command[]