Export-CrescendoCommand
Hiermee maakt u JSON-configuratiebestanden voor Crescendo-opdrachtobjecten .
Syntax
Export-CrescendoCommand
[-command] <Command[]>
[-targetDirectory <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Export-CrescendoCommand
[-command] <Command[]>
-fileName <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Met deze cmdlet maakt u JSON-configuratiebestanden voor Crescendo Command-objecten . Het kan één JSON-bestand per opdrachtobject maken of één JSON-bestand maken met alle objecten die aan het object worden doorgegeven.
Crescendo Command-objecten kunnen worden gemaakt met behulp van New-CrescendoCommand
of geïmporteerd uit een bestaande configuratie met behulp van Import-CommandConfiguration
.
Deze cmdlet is toegevoegd in Microsoft.PowerShell.Crescendo v1.1.
Voorbeelden
Voorbeeld 1: afzonderlijke JSON-bestanden per opdracht maken
In dit voorbeeld worden opdrachtobjecten geïmporteerd uit een bestaand JSON-configuratiebestand.
Export-CrescendoCommand
wordt gebruikt om afzonderlijke JSON-bestanden te maken voor elke 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
Voorbeeld 2: een nieuw JSON-configuratiebestand maken voor bestaande opdrachten
In dit voorbeeld worden opdrachtobjecten geïmporteerd uit een bestaand JSON-configuratiebestand.
Export-CrescendoCommand
wordt gebruikt om een nieuw JSON-configuratiebestand met alle opdrachten te maken.
$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
Het nieuwe JSON-bestand bevat nieuwe eigenschappen voor de huidige versie van Crescendo en verwijst naar de url van het nieuwe schema. Dit is een handige manier om een oud JSON-configuratiebestand te converteren naar de nieuwe indeling.
Parameters
-command
Een of meer Crescendo Command-objecten die moeten worden geëxporteerd.
Type: | Command[] |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-fileName
De naam van het JSON-bestand dat u wilt maken.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Force
Bestaande bestanden overschrijven.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-targetDirectory
De uitvoerlocatie voor de JSON-bestanden die voor elk opdrachtobject zijn gemaakt.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Invoerwaarden
Command[]