Export-CrescendoCommand
Skapar JSON-konfigurationsfiler för Crescendo Command-objekt.
Syntax
Export-CrescendoCommand
[-command] <Command[]>
[-targetDirectory <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Export-CrescendoCommand
[-command] <Command[]>
-fileName <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Den här cmdleten skapar JSON-konfigurationsfiler för Crescendo Kommando objekt. Den kan skapa en JSON-fil per Kommando-objekt eller skapa en JSON-fil som innehåller alla objekt som skickas till den.
Crescendo Kommando objekt kan skapas med New-CrescendoCommand
eller importeras från en befintlig konfiguration med hjälp av Import-CommandConfiguration
.
Den här cmdleten lades till i Microsoft.PowerShell.Crescendo v1.1.
Exempel
Exempel 1 – Skapa separata JSON-filer per kommando
I det här exemplet importeras Kommando objekt från en befintlig JSON-konfigurationsfil.
Export-CrescendoCommand
används för att skapa separata JSON-filer för varje 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
Exempel 2 – Skapa en ny JSON-konfigurationsfil för befintliga kommandon
I det här exemplet importeras Kommando objekt från en befintlig JSON-konfigurationsfil.
Export-CrescendoCommand
används för att skapa en ny JSON-konfigurationsfil som innehåller alla kommandon.
$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
Den nya JSON-filen innehåller nya egenskaper för den aktuella versionen av Crescendo och refererar till den nya schema-URL:en. Det här är ett praktiskt sätt att konvertera en gammal JSON-konfigurationsfil till det nya formatet.
Parametrar
-command
Ett eller flera Crescendo--kommando objekt som ska exporteras.
Typ: | Command[] |
Position: | 0 |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | True |
Godkänn jokertecken: | False |
-Confirm
Uppmanar dig att bekräfta innan du kör cmdleten.
Typ: | SwitchParameter |
Alias: | cf |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-fileName
Namnet på JSON-filen som ska skapas.
Typ: | String |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | True |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-Force
Skriv över befintliga filer.
Typ: | SwitchParameter |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-targetDirectory
Utdataplatsen för JSON-filerna som skapats för varje Kommando-objekt.
Typ: | String |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
-WhatIf
Visar vad som skulle hända om cmdleten körs. Cmdleten körs inte.
Typ: | SwitchParameter |
Alias: | wi |
Position: | Named |
Standardvärde: | None |
Obligatorisk: | False |
Godkänn pipeline-indata: | False |
Godkänn jokertecken: | False |
Indata
Command[]