Featured image of post [PowerShell] 19. Compare-Object — 객체 비교(diff)

[PowerShell] 19. Compare-Object — 객체 비교(diff)

Compare-Object(별칭 diff)로 두 컬렉션의 차이를 비교하는 법, SideIndicator(<=, =>, ==)의 의미, -Property로 특정 속성만 비교하는 법, -IncludeEqual/-PassThru 매개변수를 정리한 Part 2 마지막 챕터다.

Featured image of post [PowerShell] 22. -split/-join 연산자

[PowerShell] 22. -split/-join 연산자

PowerShell -split 연산자로 문자열을 정규식 구분자 기준으로 나누는 법과 -Max-substrings/옵션 매개변수, -join 연산자로 배열을 하나의 문자열로 합치는 법, 단항/이항 형태의 우선순위 차이를 정리한 챕터다.

Featured image of post [PowerShell] 23. 타입 캐스팅과 [type] 접근자

[PowerShell] 23. 타입 캐스팅과 [type] 접근자

[int], [string] 같은 PowerShell 타입 캐스팅 문법과 암시적/명시적 변환 규칙, -is/-isnot/-as 타입 연산자, 숫자 반올림·배열-문자열 변환처럼 자주 놀라는 변환 규칙을 정리한 챕터다.

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] 타입 가속기로 순서가 보장된 커스텀 객체를 만드는 법, 두 방식의 성능·가독성 차이와 배열 인자를 생성자에 넘길 때의 함정을 정리한 챕터다.