Featured image of post [PowerShell] 26. -WhatIf/-Confirm과 ShouldProcess

[PowerShell] 26. -WhatIf/-Confirm과 ShouldProcess

위험한 작업을 실행 전에 시뮬레이션하는 -WhatIf, 확인을 요구하는 -Confirm 매개변수의 동작 방식과 $ConfirmPreference 기본 임계값, 직접 만든 함수에 이 매개변수를 추가하는 SupportsShouldProcess를 정리한 챕터다.

Featured image of post [PowerShell] 27. New-Object와 [PSCustomObject]

[PowerShell] 27. New-Object와 [PSCustomObject]

New-Object로 .NET/COM 객체를 생성하는 법과 [PSCustomObject] 타입 가속기로 순서가 보장된 커스텀 객체를 만드는 법, 두 방식의 성능·가독성 차이와 배열 인자를 생성자에 넘길 때의 함정을 정리한 챕터다.

Featured image of post [PowerShell] 30. PSDrive와 프로바이더 개념

[PowerShell] 30. PSDrive와 프로바이더 개념

PowerShell 프로바이더가 레지스트리·인증서·환경변수 같은 서로 다른 데이터 저장소를 파일 시스템처럼 드라이브로 노출하는 원리, 내장 프로바이더 목록, Get-PSDrive/Get-PSProvider로 확인하는 법을 정리한 Part 4 시작 챕터다.

Featured image of post [PowerShell] 32. Set-Location/Push-Location/Pop-Location

[PowerShell] 32. Set-Location/Push-Location/Pop-Location

Set-Location(별칭 cd)으로 현재 위치를 바꾸는 법과 -/+로 위치 히스토리를 오가는 법, Push-Location/Pop-Location 위치 스택으로 여러 작업 디렉터리를 오가는 법, 이름 붙인 스택(-StackName)을 정리한 챕터다.

Featured image of post [PowerShell] 33. New-Item — 파일·디렉터리 생성

[PowerShell] 33. New-Item — 파일·디렉터리 생성

New-Item으로 파일·디렉터리·심볼릭 링크·레지스트리 키를 생성하는 법과 -ItemType/-Value/-Force 매개변수, 프로바이더별로 -ItemType 값이 달라지는 이유, -Force가 기존 파일을 덮어쓰는 함정을 정리한 챕터다.

Featured image of post [PowerShell] 34. Copy-Item — 복사

[PowerShell] 34. Copy-Item — 복사

Copy-Item으로 파일·디렉터리·레지스트리 키를 복사하는 법과 -Recurse/-Container/-Filter 매개변수의 상호작용, -ToSession/-FromSession으로 원격 세션과 파일을 주고받는 법을 정리한 챕터다.