Featured image of post [PowerShell] 67. trap — 레거시 예외 처리

[PowerShell] 67. trap — 레거시 예외 처리

PowerShell trap 키워드로 스코프 전체의 종료 오류를 처리하는 법과 break/continue로 이후 실행 여부를 결정하는 법, try/catch가 표준이 된 오늘날 trap을 써야 할 때와 스코프 규칙의 차이를 정리한 챕터다.

Featured image of post [PowerShell] 68. Write-Verbose/Debug/Warning/Information

[PowerShell] 68. Write-Verbose/Debug/Warning/Information

PowerShell Write-Verbose/Write-Debug/Write-Warning/Write-Information이 각각 다른 출력 스트림에 쓰는 원리와 -Verbose/-Debug 공통 매개변수로 표시 여부를 켜는 법, 29장 Write-Host와의 차이를 정리한 챕터다.

Featured image of post [PowerShell] 69. Start-Transcript — 세션 기록

[PowerShell] 69. Start-Transcript — 세션 기록

Start-Transcript로 PowerShell 세션의 입력·출력 전체를 텍스트 파일로 기록하는 법과 -Path/-Append/-IncludeInvocationHeader 매개변수, Stop-Transcript와의 관계, 프로필에 등록해 세션 전체를 기록하는 법을 정리한 챕터다.

Featured image of post [PowerShell] 70. Set-PSBreakpoint — 스크립트 디버깅

[PowerShell] 70. Set-PSBreakpoint — 스크립트 디버깅

Set-PSBreakpoint로 스크립트에 줄/명령/변수 단위 브레이크포인트를 거는 법과 -Action 매개변수로 조건부 중단을 만드는 법, Get-PSBreakpoint/Remove-PSBreakpoint로 관리하는 법을 정리한 Part 7 마지막 챕터다.

Featured image of post [PowerShell] 71. Pester 소개 — Describe/It/Should

[PowerShell] 71. Pester 소개 — Describe/It/Should

PowerShell 표준 테스트 프레임워크 Pester의 Describe/Context/It 블록 구조와 Should 어서션으로 함수 동작을 검증하는 법, BeforeAll로 테스트 대상 함수를 불러오는 법을 정리한 Part 8 시작 챕터다.

Featured image of post [PowerShell] 73. Measure-Command — 성능 측정과 벤치마킹

[PowerShell] 73. Measure-Command — 성능 측정과 벤치마킹

Measure-Command로 스크립트 블록 실행 시간을 TimeSpan으로 측정하는 법과 -Expression이 현재 스코프에서 실행되는 부작용, 결과가 화면에 표시되지 않는 이유, 여러 구현을 비교 벤치마킹하는 법을 정리한 Part 8 마지막 챕터다.

Featured image of post [PowerShell] 75. Import-Module/Get-Module/Remove-Module

[PowerShell] 75. Import-Module/Get-Module/Remove-Module

PowerShell 모듈 자동 로딩(module autoloading) 원리와 Import-Module로 수동 임포트하는 법, Get-Module -ListAvailable로 설치된 모듈을 찾는 법, Remove-Module로 세션에서 제거하는 법을 정리한 챕터다.