Export-CrescendoCommand
Crescendo Command 개체에 대한 JSON 구성 파일을 만듭니다.
구문
Export-CrescendoCommand
[-command] <Command[]>
[-targetDirectory <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Export-CrescendoCommand
[-command] <Command[]>
-fileName <String>
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
이 cmdlet은 Crescendo Command 개체에 대한 JSON 구성 파일을 만듭니다. Command 개체당 하나의 JSON 파일을 만들거나 전달된 모든 개체를 포함하는 JSON 파일을 하나 만들 수 있습니다.
Crescendo Command 개체는 New-CrescendoCommand
사용하여 만들거나 Import-CommandConfiguration
사용하여 기존 구성에서 가져올 수 있습니다.
이 cmdlet은 microsoft.PowerShell.Crescendo v1.1에 추가되었습니다.
예제
예제 1 - 명령당 별도의 JSON 파일 만들기
이 예제에서는 Command 개체를 기존 JSON 구성 파일에서 가져옵니다.
Export-CrescendoCommand
각 cmdlet에 대해 별도의 JSON 파일을 만드는 데 사용됩니다.
$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
예제 2 - 기존 명령에 대한 새 JSON 구성 파일 만들기
이 예제에서는 Command 개체를 기존 JSON 구성 파일에서 가져옵니다.
Export-CrescendoCommand
모든 명령을 포함하는 새 JSON 구성 파일을 만드는 데 사용됩니다.
$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
새 JSON 파일에는 현재 버전의 Crescendo에 대한 새 속성이 포함되어 있으며 새 스키마 URL을 참조합니다. 이는 이전 JSON 구성 파일을 새 형식으로 변환하는 편리한 방법입니다.
매개 변수
-command
하나 이상의 Crescendo Command 내보낼 개체입니다.
형식: | Command[] |
Position: | 0 |
Default value: | None |
필수: | True |
파이프라인 입력 허용: | True |
와일드카드 문자 허용: | False |
-Confirm
cmdlet을 실행하기 전에 확인 메시지를 표시합니다.
형식: | SwitchParameter |
별칭: | cf |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-fileName
만들 JSON 파일의 이름입니다.
형식: | String |
Position: | Named |
Default value: | None |
필수: | True |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-Force
기존 파일을 덮어씁 수 있습니다.
형식: | SwitchParameter |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-targetDirectory
각 Command 개체에 대해 만든 JSON 파일의 출력 위치입니다.
형식: | String |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
-WhatIf
cmdlet이 실행되면 어떻게 되는지 보여 주세요. cmdlet이 실행되지 않습니다.
형식: | SwitchParameter |
별칭: | wi |
Position: | Named |
Default value: | None |
필수: | False |
파이프라인 입력 허용: | False |
와일드카드 문자 허용: | False |
입력
Command[]
출력
관련 링크
PowerShell