PowerShell CLI 가이드

42의 명령어를 찾았습니다

Get-Process
process
실행 중인 프로세스 정보 조회

사용법:

PS> Get-Process Get-Process -Name chrome Get-Process | Where-Object {$_.CPU -gt 10}
process
task
management
Start-Process
process
새 프로세스 시작

사용법:

PS> Start-Process notepad Start-Process -FilePath chrome.exe -ArgumentList 'www.google.com'
start
launch
process
Stop-Process
process
프로세스 종료

사용법:

PS> Stop-Process -Name chrome Stop-Process -Id 1234 -Force
stop
kill
process
Get-Service
service
서비스 정보 조회

사용법:

PS> Get-Service Get-Service -Name *sql* Get-Service | Where-Object {$_.Status -eq 'Running'}
service
windows
management
Start-Service
service
서비스 시작

사용법:

PS> Start-Service -Name MSSQLSERVER Start-Service -InputObject (Get-Service -Name MSSQLSERVER)
start
service
windows
Stop-Service
service
서비스 중지

사용법:

PS> Stop-Service -Name MSSQLSERVER Stop-Service -InputObject (Get-Service -Name MSSQLSERVER) -Force
stop
service
windows
Get-EventLog
log
이벤트 로그 조회

사용법:

PS> Get-EventLog -LogName System Get-EventLog -LogName Application -Newest 10
event
log
windows
Get-WmiObject
system
WMI 정보 조회

사용법:

PS> Get-WmiObject -Class Win32_OperatingSystem Get-WmiObject -Class Win32_Process
wmi
system
information
Get-NetAdapter
network
네트워크 어댑터 정보 조회

사용법:

PS> Get-NetAdapter Get-NetAdapter | Where-Object {$_.Status -eq 'Up'}
network
adapter
interface
Get-NetIPAddress
network
IP 주소 정보 조회

사용법:

PS> Get-NetIPAddress Get-NetIPAddress -AddressFamily IPv4
network
ip
address
Get-NetRoute
network
라우팅 테이블 조회

사용법:

PS> Get-NetRoute Get-NetRoute -AddressFamily IPv4
network
route
routing
Get-DnsClientServerAddress
network
DNS 서버 주소 조회

사용법:

PS> Get-DnsClientServerAddress Get-DnsClientServerAddress -InterfaceIndex 12
network
dns
server
Get-NetFirewallRule
security
방화벽 규칙 조회

사용법:

PS> Get-NetFirewallRule Get-NetFirewallRule -Enabled True
firewall
security
rule
New-NetFirewallRule
security
방화벽 규칙 생성

사용법:

PS> New-NetFirewallRule -DisplayName 'Allow Port 80' -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
firewall
security
rule
Get-ADUser
active-directory
Active Directory 사용자 정보 조회

사용법:

PS> Get-ADUser -Filter * Get-ADUser -Identity 'john.doe'
ad
user
directory
Get-ADComputer
active-directory
Active Directory 컴퓨터 정보 조회

사용법:

PS> Get-ADComputer -Filter * Get-ADComputer -Identity 'SERVER01'
ad
computer
directory
Get-ADGroup
active-directory
Active Directory 그룹 정보 조회

사용법:

PS> Get-ADGroup -Filter * Get-ADGroup -Identity 'Administrators'
ad
group
directory
Get-ChildItem
file
디렉토리 내용 조회

사용법:

PS> Get-ChildItem Get-ChildItem -Path C:\ -Recurse -Filter *.txt
file
directory
ls
Copy-Item
file
파일/디렉토리 복사

사용법:

PS> Copy-Item -Path source.txt -Destination dest.txt Copy-Item -Path C:\source -Destination D:\backup -Recurse
file
copy
cp
Move-Item
file
파일/디렉토리 이동

사용법:

PS> Move-Item -Path source.txt -Destination dest.txt Move-Item -Path C:\source -Destination D:\backup
file
move
mv
Remove-Item
file
파일/디렉토리 삭제

사용법:

PS> Remove-Item file.txt Remove-Item -Path C:\temp -Recurse -Force
file
delete
rm
New-Item
file
새 파일/디렉토리 생성

사용법:

PS> New-Item -Path file.txt -ItemType File New-Item -Path C:\temp -ItemType Directory
file
create
mkdir
Get-Content
file
파일 내용 읽기

사용법:

PS> Get-Content file.txt Get-Content -Path file.txt -Tail 10
file
read
cat
Set-Content
file
파일 내용 쓰기

사용법:

PS> Set-Content -Path file.txt -Value 'Hello, World!' 'Hello' | Set-Content file.txt
file
write
echo
Add-Content
file
파일 내용 추가

사용법:

PS> Add-Content -Path file.txt -Value 'New line' 'New line' | Add-Content file.txt
file
append
write
Get-Disk
storage
디스크 정보 조회

사용법:

PS> Get-Disk Get-Disk -Number 0
disk
storage
hardware
Get-Partition
storage
파티션 정보 조회

사용법:

PS> Get-Partition Get-Partition -DiskNumber 0
partition
disk
storage
Get-Volume
storage
볼륨 정보 조회

사용법:

PS> Get-Volume Get-Volume -DriveLetter C
volume
drive
storage
Get-Printer
printer
프린터 정보 조회

사용법:

PS> Get-Printer Get-Printer -Name 'HP LaserJet'
printer
print
device
Get-PrintJob
printer
인쇄 작업 정보 조회

사용법:

PS> Get-PrintJob Get-PrintJob -PrinterName 'HP LaserJet'
printer
job
print
Get-ScheduledTask
task
예약 작업 정보 조회

사용법:

PS> Get-ScheduledTask Get-ScheduledTask -TaskName 'Backup'
task
schedule
job
Register-ScheduledTask
task
예약 작업 등록

사용법:

PS> Register-ScheduledTask -TaskName 'Backup' -Action (New-ScheduledTaskAction -Execute 'backup.exe')
task
schedule
job
Get-Process
process
프로세스 정보 조회

사용법:

PS> Get-Process Get-Process -Name chrome
process
task
management
Get-Service
service
서비스 정보 조회

사용법:

PS> Get-Service Get-Service -Name *sql*
service
windows
management
Get-EventLog
log
이벤트 로그 조회

사용법:

PS> Get-EventLog -LogName System Get-EventLog -LogName Application -Newest 10
event
log
windows
Get-WmiObject
system
WMI 정보 조회

사용법:

PS> Get-WmiObject -Class Win32_OperatingSystem Get-WmiObject -Class Win32_Process
wmi
system
information
Get-NetAdapter
network
네트워크 어댑터 정보 조회

사용법:

PS> Get-NetAdapter Get-NetAdapter | Where-Object {$_.Status -eq 'Up'}
network
adapter
interface
Get-NetIPAddress
network
IP 주소 정보 조회

사용법:

PS> Get-NetIPAddress Get-NetIPAddress -AddressFamily IPv4
network
ip
address
Get-NetRoute
network
라우팅 테이블 조회

사용법:

PS> Get-NetRoute Get-NetRoute -AddressFamily IPv4
network
route
routing
Get-DnsClientServerAddress
network
DNS 서버 주소 조회

사용법:

PS> Get-DnsClientServerAddress Get-DnsClientServerAddress -InterfaceIndex 12
network
dns
server
Get-NetFirewallRule
security
방화벽 규칙 조회

사용법:

PS> Get-NetFirewallRule Get-NetFirewallRule -Enabled True
firewall
security
rule
New-NetFirewallRule
security
방화벽 규칙 생성

사용법:

PS> New-NetFirewallRule -DisplayName 'Allow Port 80' -Direction Inbound -Protocol TCP -LocalPort 80 -Action Allow
firewall
security
rule