Featured image of post [PowerShell] 39. Test-Path — 경로 존재 확인

[PowerShell] 39. Test-Path — 경로 존재 확인

Test-Path로 경로 존재 여부를 확인하는 법과 -PathType으로 파일/디렉터리를 구분하는 법, -IsValid로 문법만 검사하는 법, $null·빈 문자열 입력 시 반환값 차이, 레지스트리 값 확인의 함정을 정리한 챕터다.

Featured image of post [PowerShell] 41. 변수와 데이터 타입

[PowerShell] 41. 변수와 데이터 타입

PowerShell 변수 이름 규칙과 $ 접두사, [int]·[string] 같은 타입 제약(type-constrain) 문법, 변수 스코프의 기본 개념, Variable: 프로바이더로 변수를 항목처럼 다루는 법을 정리한 Part 5 시작 챕터다.

Featured image of post [PowerShell] 42. 배열과 컬렉션 기초

[PowerShell] 42. 배열과 컬렉션 기초

PowerShell 배열 @() 생성 문법과 인덱싱, 음수 인덱스, 범위 슬라이싱, .ForEach()/.Where() 메서드, Count/Length 속성, 다차원 배열과 재정렬 배열(jagged array)의 차이를 정리한 챕터다.

Featured image of post [PowerShell] 43. ArrayList와 Generic List(List<T>)

[PowerShell] 43. ArrayList와 Generic List(List<T>)

42장 배열의 += 성능 문제를 해결하는 System.Collections.ArrayList와 System.Collections.Generic.List<T>의 Add/Remove 메서드 사용법, 두 컬렉션의 타입 안전성 차이, 언제 배열 대신 이들을 선택해야 하는지 정리한 챕터다.

Featured image of post [PowerShell] 44. 해시테이블(Hashtable) 다루기

[PowerShell] 44. 해시테이블(Hashtable) 다루기

PowerShell 해시테이블 @{} 생성 문법과 키-값 접근법, [ordered]@{}로 순서를 보존하는 법, Keys/Values 속성과 GetEnumerator()로 순회하는 법, ConvertFrom-StringData로 텍스트를 해시테이블로 바꾸는 법을 정리한 챕터다.

Featured image of post [PowerShell] 45. 문자열 서식과 Here-String

[PowerShell] 45. 문자열 서식과 Here-String

작은따옴표와 큰따옴표의 문자열 전개(interpolation) 차이, 이스케이프 문자 백틱(`), -f 서식 연산자, 여러 줄 텍스트를 다루는 Here-String(@"..."@) 문법을 정리한 PowerShell 문자열 서식 챕터다.

Featured image of post [PowerShell] 47. -match/-replace 연산자와 정규식

[PowerShell] 47. -match/-replace 연산자와 정규식

PowerShell -match/-replace 연산자가 .NET 정규식 엔진을 쓰는 원리와 $Matches 자동 변수로 캡처 그룹을 꺼내는 법, 이름 있는 캡처 그룹, -replace 치환 문자열에서 $1·${name}으로 참조하는 법을 정리한 챕터다.

Featured image of post [PowerShell] 48. ConvertTo-Json/ConvertFrom-Json

[PowerShell] 48. ConvertTo-Json/ConvertFrom-Json

ConvertTo-Json으로 객체를 JSON 문자열로 바꾸는 법과 -Depth 기본값 함정, ConvertFrom-Json으로 JSON을 PSCustomObject나 -AsHashtable로 되돌리는 법, REST API 연동에서 두 cmdlet이 하는 역할을 정리한 챕터다.