Featured image of post [PowerShell] 49. Import-Csv/Export-Csv/ConvertTo-Csv

[PowerShell] 49. Import-Csv/Export-Csv/ConvertTo-Csv

Import-Csv로 CSV 파일을 PSCustomObject 배열로 읽는 법과 Export-Csv의 -NoTypeInformation 기본값 변화, -Append/-Delimiter 매개변수, Format-Table을 CSV 저장 전에 쓰면 안 되는 이유를 정리한 챕터다.

Featured image of post [PowerShell] 50. ConvertTo-Html과 Out-File

[PowerShell] 50. ConvertTo-Html과 Out-File

ConvertTo-Html로 객체를 HTML 표·목록으로 바꾸는 법과 -Property/-CssUri/-Fragment 매개변수, Out-File로 화면 서식 그대로 파일에 저장하는 법과 리다이렉션 연산자(>)와의 관계를 정리한 챕터다.

Featured image of post [PowerShell] 51. Out-String과 Out-Null

[PowerShell] 51. Out-String과 Out-Null

Out-String으로 객체를 콘솔 서식 그대로 텍스트 문자열로 바꿔 Select-String 같은 텍스트 도구와 연결하는 법과 -Stream 매개변수, 명령 출력을 완전히 없애는 Out-Null 사용법을 정리한 챕터다.

Featured image of post [PowerShell] 52. Get-Date와 TimeSpan

[PowerShell] 52. Get-Date와 TimeSpan

Get-Date로 현재 시각을 DateTime 객체로 받는 법과 -Format/-UFormat 서식 지정자 차이, -AsUTC로 시간대를 변환하는 법, 두 날짜를 뺄셈해 TimeSpan을 얻는 법을 정리한 Part 5 마지막 챕터다.

Featured image of post [PowerShell] 53. 스크립트 작성과 실행(.ps1)

[PowerShell] 53. 스크립트 작성과 실행(.ps1)

PowerShell .ps1 스크립트 파일을 실행하는 법과 실행 정책의 관계, param() 블록으로 스크립트 인자를 받는 법, 점 소싱(dot sourcing)으로 스크립트의 함수·변수를 현재 세션에 가져오는 법을 정리한 Part 6 시작 챕터다.

Featured image of post [PowerShell] 54. if/elseif/else — 조건 분기

[PowerShell] 54. if/elseif/else — 조건 분기

PowerShell if/elseif/else 문법과 조건식 평가 방식, PowerShell 7부터 도입된 삼항 연산자(?:) 문법, elseif 체인이 길어질 때 switch 문으로 바꿔야 하는 이유를 정리한 챕터다.

Featured image of post [PowerShell] 57. 함수 정의와 매개변수

[PowerShell] 57. 함수 정의와 매개변수

PowerShell function 키워드로 함수를 만드는 법과 param() 블록으로 명명된 매개변수를 정의하는 법, 위치 매개변수와 $args 배열의 관계, 파이프라인을 처리하는 process 블록과 filter 키워드의 역할을 정리한 챕터다.

Featured image of post [PowerShell] 58. [CmdletBinding()]과 고급 함수

[PowerShell] 58. [CmdletBinding()]과 고급 함수

PowerShell [CmdletBinding()] 속성이 일반 함수를 컴파일된 cmdlet처럼 만드는 원리와 공통 매개변수 자동 추가, SupportsShouldProcess로 -WhatIf/-Confirm을 얻는 법, $PSCmdlet 자동 변수를 정리한 챕터다.