FAQ POWERSHELL KENG LENGWAHING KAPAMPANGAN

By | June 23, 2015

translated-kapampangan


beta-v2-0


Konseptu : Deng maralas a kukutang keng PowerShell.

Malyari meng gamitan ing listaan keng miyayaliwang paralan :

  • Para kopyan at ikabit deng commands keng script
  • Para tambing yang akit ing syntax na ning metung a command
  • Para palagwan ya pa ing teknikal a kebalwan
  • Para adiskubri la reng bayung commands
  • Para paghandaan ya ing bayung interbyu

Me-update ya
Abril 28, 2015
Miki-akdaSteve Renard
Pibatankapampangan.powershell-guru.com
Kategorya
75
Kutang
610


ACL
Active Directory
Alias
Arrays
Browsers
Certificates
Characters
CIM
Comments
COM Objects
Compare
Computer
Credentials
CSV
Culture
Date
Drives
Environment
Errors
Event Viewer
Files
Folders
Format Operator (-f)
Functions
GPO
GUI
Hardware
Hashtables
Help
History
Jobs
Keyboard
Loops
Math
Memory
Messages
Modules
Microsoft Excel
Microsoft Exchange
Microsoft Outlook
Microsoft SharePoint
Networking
Openfiles
Operators
Parameters
Password
Powershell ISE
Printers
Processes
PSObject
Quest
Random
RDP
Regedit
Regex
Remote
Restore
Scheduled Tasks
Search
SCCM
Services
SMTP
Snapins
Sounds
Static .NET Methods
Strings
System
Try/Catch
Variables
Symantec Vault
Windows10
Windows 2012
Windows Azure
Windows Forms
WMI
XML

System

Makananu keng abalu ing bersyun na ning PowerShell ku?

Makananu keng paganan ing PowerShell keng aliwang bersyun para keng pabalik a kompatibilidad?
powershell.exe -Version 2.0

Makananung mangailangang simpling bersyun ning PowerShell (3.0 o mas matas) keng sulat ning PowerShell?
#Requires -Version 3.0

Makananung mangailangang pamunang pribilehiyu para keng sulat keng PowerShell?

Makananu lang lawen reng ulaga da reng kapasidad na ning sulat keng PowerShell?
help -Name .\Get-ExchangeEnvironmentReport.ps1 -Full

Makananung manikwang impormasyun para keng kasalukuyang gagamit keng PowerShell?
[Security.Principal.WindowsIdentity]::GetCurrent()

Makananung gawa, samasan, at ireload ing profile keng PowerShell?

Makananung yang ituknang ing sulat keng PowerShell kilub na ning 5 segundu/minutu?
Start-Sleep -Seconds 5
Start-Sleep -Seconds 300 # 5 minutes

Makananu yang akwa ing talwing oras na ning pamagboot keng PowerShell?
(Get-CimInstance -ClassName win32_operatingsystem).LastBootUpTime

Makananu yang akwa ing pampabilis pamagtype keng PowerShell?

Makananu lang ilista reng pamagumpisang programa keng PowerShell?

Makananung maglakong application gamit ing PowerShell?

Makananung kumang screenshot na ning buung desktop o kaya ing aktibung window keng PowerShell?
Take-ScreenShot -Screen -File 'C:\scripts\screenshot.png' -Imagetype JPEG
Repository : Take-ScreenShot

Makananung manikwang bilang da reng mensai para keng makaabang a MSMQ keng PowerShell?

Makananung yang kabit ing execution policy keng PowerShell?

Makananung gawang pinakasimpling paralan keng PowerShell?

Makananu lang dikit at ilako dikit keng taskbar reng programa keng PowerShell?

Makananu yang buklat ing Windows Explorer keng PowerShell?
[Diagnostics.Process]::Start('explorer.exe')
Invoke-Item -Path C:\Windows\explorer.exe

Makananung maglistang drivers para kareng device keng PowerShell?
Get-WmiObject -Class Win32_PnPSignedDriver
Get-WindowsDriver -Online -All
driverquery.exe

Makananung gawang GUID keng PowerShell

Makananung kumang lugar para keng pansamantalang talaturu para keng kasaluyang gagamitan keng PowerShell?
[System.IO.Path]::GetTempPath()

Makananung makyabe keng path ampo keng child path keng metung mung path keng PowerShell?
Join-Path -Path C:\ -ChildPath \windows

Makananu la ngan ilista deng cmdlets “Get-*” keng PowerShell?
Get-Command -Verb Get

Makananung maglistang aliwang klasing sistema keng PowerShell?

Makananung ikabit ing ISO/VHD files keng PowerShell?
Mount-DiskImage 'D:\ISO\file.iso' # ISO
Mount-DiskImage 'D:\VHD\file.vhd' # VHD

Makananung lang lawen reng .NET Frameworks a bersyun a makakabit keng PowerShell?

Makananu lawen nung makainstall ya keng PowerShell ing .NET Framework 4.5 bersyun?
(Get-ItemProperty -Path 'HKLM:\Software\Microsoft\NET Framework Setup\NDP\v4\Full' -EA 0).Version -like '4.5*'

Makananung umpisan o ituknang ing transcript (para makagawang record da reng session ning Windows PowerShell) keng PowerShell?
Start-Transcript -Path 'C:\scripts\transcript.txt
Stop-Transcript

Makananu yang palitan ing kasalukuyang directory keng saktung lokasyun keng PowerShell?
Set-Location -Path 'C:\scripts'

Makananu yang lako laman ing screnn keng PowerShell?
Clear-Host
cls # Alias

Makananu yang palitan ing resolution na ning display keng PowerShell?
Set-DisplayResolution -Width 1280 -Height 1024 -Force # Windows 2012

Makananung kabit keng “full screen” window keng PowerShell?
mode.com 300

Makananung manikwang sukad (kapal ampong katas) na ning letratu keng PowerShell?

Makananung mankikwang Windows product key keng PowerShell?

Perfmon

Makananung yang akwa ing kasalukuyang “% Processor Time” (saktu) keng talwing limang segundu (10 besis) keng PowerShell?
(Get-Counter '\Processor(_total)\% Processor Time' -SampleInterval 5 -MaxSamples 10).CounterSamples.CookedValue

Assemblies

Makananung iload reng assembly keng PowerShell?

Makananung lawen reng kasalukuyang .NET assemblies na atyu keng PowerShell?

Makananu yang pantunan ing GAC (Global Assembly Cache) path keng PowerShell?

Clipboard

Makananung lang kopyan deng resulta keng clipboard keng PowerShell?

Makananung manikwang laman keng clipboard keng PowerShell?
Add-Type -AssemblyName PresentationCore
[Windows.Clipboard]::GetText()

Hotfixes

Makananung manikwang hotfixes na makakabit keng PowerShell?
Get-HotFix -ComputerName $computer

Makananung manikwang hotfixes bayu/kaybat ning saktung petsa keng PoweShell?
Get-HotFix | Where-Object -FilterScript { $_.InstalledOn -lt ([DateTime]'01/01/2015') } # Before 01/01/2015
Get-HotFix | Where-Object -FilterScript {$_.InstalledOn -gt ([DateTime]'01/01/2015')} # After 01/01/2015

Makananung lawen nung makakabit ya ing hotfix keng PowerShell?
Get-HotFix -Id KB2965142

Makananu lang akwa reng hotfixes na makakabit keng metung a remote kompyuter keng PowerShell?
Get-HotFix -ComputerName $computer

Pagefile

Makananung manikwang impormasyun ning Pagefile keng PowerShell?
Get-WmiObject -Class Win32_PageFileusage | Select-Object -Property Name, CurrentUsage, AllocatedBaseSize, PeakUsage, InstallDate

Makananung manikwang ustung skad (MB) para keng Pagefile keng PowerShell?
[Math]::Truncate(((Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory) / 1MB) * 1.5

Makananung gawang Pagefile (4096MB) keng (D:) drive keng PowerShell?

Makananung buran ing Pagefile keng (C:) drive keng PowerShell?

Maintenance

Makananung lawen ing partisyun na ning drive keng PowerShell?

Makananung lawen ing espasyu ning disk keng drive keng PowerShell?

Up


Files

Makananu yang buklat keng PowerShell ing metung a file?
Invoke-Item -Path 'C:\scripts\file.txt'
.'C:\scripts\file.txt'

Makananu yang basan ing metung a file keng PowerShell?
Get-Content -Path 'C:\scripts\file.txt'
gc "C:\scripts\file.txt" # Alias

Makananung sumulat output keng PowerShell?
'Line1', 'Line2', 'Line3' | Out-File -FilePath 'C:\scripts\file.txt'
'Line1', 'Line2', 'Line3' | Add-Content -Path file.txt

Makananu yang akwa ing buung lagyu ning kasalukuyang script file keng PowerShell?
$MyInvocation.MyCommand.Path

Makananung magcompress/magzip files keng PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::CreateFromDirectory($folder,$fileZIP)

Makananun lang ilako pangacompress/pangazip deng files keng PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::ExtractToDirectory($fileZIP, $folder)

Makananu yang lawen ing file keng ZIP archive keng PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::OpenRead($fileZIP)

Makananu yang palto ing sukad (KB) na ning file keng PowerShell?
(Get-ChildItem -Path .\winsrv.dll).Length /1KB
(Get-ChildItem -Path .\winsrv.dll).Length /1MB
(Get-ChildItem -Path .\winsrv.dll).Length /1GB

Makananu lang pantunan deng files a mas maragul o mas malati keng 1 GB keng PowerShell?

Makananu yang palto ing lagyu na ning file anggang alayu ing extension keng PowerShell?
[System.IO.Path]::GetFileNameWithoutExtension('C:\Windows\system32\calc.exe') # Return calc

Makananu yang palto ing extension na ning file keng PowerShell?
[System.IO.Path]::GetExtension('C:\scripts\file.txt') # Return .txt

Makananu yang palto ing bersyun na ning file keng PowerShell?

Makananu yang kwanan ing hash na ning file keng PowerShell?
(Get-FileHash $file).Hash

Makananu yang kunan ing MD5/SHA1 checksum na ning file keng PowerShell?
Get-FileHash $file -Algorithm MD5
Get-FileHash $file -Algorithm SHA1

Makananu lang palto reng makasalikut a files keng PowerShell?

Makananu yang lawen nung atin yang extensyon keng PowerShell ing metung a file?

Makananu yang kabit keng “Rea Only” ing metung a file keng PowerShell?
Set-ItemProperty -Path .\file.txt -Name IsReadOnly -Value $true

Makananu yang palitan ing “LastWriteTime” na ning file keng milabas a paruminggu keng PowerShell?
Set-ItemProperty -Path .\file.txt -Name LastWriteTime -Value ((Get-Date).AddDays(-7))
If not working, use Nirsoft tool: BulkFileChanger.

Makananung gawang bayung file keng PowerShell?
New-Item -ItemType File -Path 'C:\scripts\file.txt' -Value 'FirstLine'

Makananu yang palitan lagyu keng PowerShell ing metung a file?
Rename-Item -Path 'C:\scripts\file.txt' -NewName 'C:\scripts\powershellguru2.txt'

Makananung lang misanang palitan lagyu reng madakal a files keng PowerShell?
Get-ChildItem -Path C:\scripts\txt | Rename-Item -NewName { $_.Name -replace ' ', '_' }

Makananung mamurang lagyu keng PowerShell?
Remove-Item -Path 'C:\scripts\file.txt'

Makananu lang palto reng talwing apulung (10) linya na ning metung a file keng PowerShell?
Get-Content -Path 'C:\scripts\log.txt' -Tail 10

Makananu lang ilako pangablock deng mapilan a files na ning folder keng PowerShell?
Get-ChildItem -Path 'C:\scripts\Modules' | Unblock-File

Makananung maglakong files a alang laman keng PowerShell?
(Get-Content -Path file.txt) | Where-Object -FilterScript {$_.Trim() -ne '' } | Set-Content -Path file.txt

Makananung lawen nung alayu ing file keng PowerShell?

Makananu yag akwa ing pekabayu/pekaluma na file a megawa keng metung a folder keng PowerShell?

Makananung ilako ing meg-ulit a linya ibat keng file keng PowerShell?

Makananung manikwang files a megawa mga metung a bulan ing milabas keng folder keng PowerShell?

Makananung manikwang files a megawa mga metung a banwa ing milabas keng folder keng PowerShell?

Makananu yang ilipat ulaga ing metung a variable keng file keng PowerShell?
Set-Content -Path file.txt -Value $variable

Makananu lang abilang deng files (*.txt) na atsu keng folder keng PowerShell?

Makananung pantunan ing string keng kilub da reng marakal a files keng PowerShell?
Select-String -Path 'C:\*.txt' -Pattern 'Steve'

Makananu yang palto ing mumuna at talwing linya na ning file keng PowerShell?

Makananu yang palto ing saktung numeru ning linya na ning file keng PowerShell?

Makananu lang abilang keng PowerShell ing linya na ning file?

Makananu lang abilang keng PowerShell deng characters at salita na atsu keng file?

Makananung magdownload file keng PowerShell?
Invoke-WebRequest -Uri 'http://www.nirsoft.net/utils/searchmyfiles.zip' -OutFile 'C:\tools\searchmyfiles.zip'

Makananu yang palto ing buung path na ning metung a file keng PowerShell?
Resolve-Path -Path .\script.ps1 # Return C:\Scripts\script.ps1

Copy

Makananung mangopyang metung a file at ilipat keng folder keng PowerShell?
Copy-Item -Path 'C:\source\file.txt' -Destination 'C:\destination'

Makananung mangopyng metung a file at ilipat kareng marakal a folders keng PowerShell?

Makananung mangopyang marakal a files at ilipat keng metung a folder keng PowerShell?
Get-ChildItem -Path 'C:\source' -Filter *.txt | Copy-Item -Destination 'C:\destination'

Up


Active Directory

Domain & Forest

Computers

Groups

Organizational Unit (OU)

Users

Domain & Forest

Makananung pantunan ing Global Catalog servers keng Archive Directory keng PowerShell?
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().GlobalCatalogs

Makananung mantun sites keng Active Directory keng PowerShell?
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites

Makananu yang pantunan ing kasalukuyang pangontrol keng domain keng PowerShell?
(Get-ADDomainController).HostName

Makananu la ngan pantunan deng pangontrol keng domain king metung a domain keng PowerShell?

Makananu lang pantunan deng ali megtagumpeng AD replication keng PowerShell?
Get-ADReplicationFailure dc02.domain.com # Windows 8 and 2012

Makananu yang pantunan ing tombstone lifetime para keng forest keng Active Directory keng PowerShell?

Makananung manikwang detalye na ning forest/domain keng Active Directory keng PowerShell?

Makananu yang akwa ing delanan na ning pidukanan da reng “Meburang Bage” keng Active Directory keng PowerShell?
(Get-ADDomain).DeletedObjectsContainer

Makananu yang paganan ing AD Recycle Bin keng Active Directory keng PowerShell?

Makananu yang ibalik ing meburang AD account na ibat keng Active Directory keng PowerShell?
Get-ADObject -Filter 'samaccountname -eq "powershellguru"' -IncludeDeletedObjects | Restore-ADObject

Makananu lang pantunan deng FSMO roles keng PowerShell?

Makananung makakonekta keng eksaktung domain controller keng PowerShell?
Get-ADUser -Identity $user -Server 'serverDC01'

Makananu yang akwa ing kasalukuyang logon server keng PowerShell?

Makananung gawan ing “gpupdate” keng kompyuter keng PowerShell?
Invoke-GPUpdate -Computer $computer -Force -RandomDelayInMinutes 0 # Windows 2012

Groups

Makananung gawang bayungg grupu keng Active Directory keng PowerShell?

Makananung maglakong grupu keng Active Directory keng PowerShell?
Remove-ADGroup -Identity 'PowershellGuru'

Makananung magdagdag user keng grupu keng Active Directory keng PowerShell?
Add-ADGroupMember "Powershell Guru" -Members powershellguru

Makananung maglako user keng grupu keng Active Directory keng PowerShell?
Remove-ADGroupMember 'Powershell Guru' -Members powershellguru

Makananung mantun grupung alang laman (alang myembru) keng Active Directory keng PowerShell?
Get-ADGroup -Filter * -Properties Members | Where-Object -FilterScript {-not $_.Members}

Makananu lang abilang deng grupung alang laman (alang myembru) keng Active Directory keng PowerShell?
(Get-ADGroup -Filter * -Properties Members | Where-Object -FilterScript {-not $_.Members}).Count

Makananung manikwang myembru keng grupu na ning Active Directory keng PowerShell?

Makananung manikwang myembru keng grupu na ating megulit a myebru keng Active Directory keng PowerShell?

Makananung mamilang myembru keng grupu atin o alang megulit a myembru keng ACtive Directory keng PowerShell?

Users

Makananu yang gamitan ing wildcard keng filter na ning “Get-ADUser” keng Active Directory keng PowerShell?

Makananu yang ilipat ing user keng metung pang OU keng Active Directory keng PowerShell?
Move-ADObject -Identity $dn -TargetPath 'OU=myOU,DC=domain,DC=com'

Makananu la ngan akit deng myembru na ning metung a user keng PowerShell?
Get-ADGroup -LDAPFilter "(member:1.2.840.113556.1.4.1941:=$($dn))"

Makananu lang akwa reng myembru (malating lagyu) para keng metung a user keng PowerShell?
(Get-ADUser $user -Properties MemberOf).MemberOf | ForEach-Object -Process {($_ -split ',')[0].Substring(3)} | Sort-Object

Makananu yang palitan lagyu (Buung Lagyu), (Makaltong Lagyu), (Mumunang Lagyu), at Apelidu para keng metung a user account keng Active Directory keng PowerShell?

Makananu yang palitan ing Deskripsyun, Opisina, Numeru ning teleponu para keng metung a user keng Active Directory keng PowerShell?
Set-ADUser $samAccountName -Description 'IT Consultant' -Office 'Building B' -OfficePhone '12345'

Makananu yang palitang ing petsa na ning expiration keng “31/12/2015” o kaya “Never” para keng metung a user account keng Active Directory keng PowerShell?

Makananu yang ilako pangalock ing user account keng Active Directory keng PowerShell?
Unlock-ADAccount $samAccountName

Makananu yang paganan/ituknang ing metung a user account keng Active Directory keng PowerShell?

Makananung maglakong user acccount keng Active Directory keng PowerShell?
Remove-ADUser $samAccountName

Makananu yang palitan ing password na ning metung a user account keng Active Directory keng PowerShell?

Makananu lang palitan deng password da reng mapilan o marakal a user account keng Active Directory keng PowerShell?

Makananu yang pantunan ing mikibandi keng file keng Active Directory keng PowerShell?

Makananu yang pantunan ing OU (Organizational Unit) para keng user keng Active Directory keng PowerShell?
[regex]::match("$((Get-ADUser $user -Properties DistinguishedName).DistinguishedName)",'(?=OU=)(.*\n?)').value

Makananu lang pantunan deng mituknang a user accounts keng Active Directory keng PowerShell?

Makananu lang pantunan deng expired user accounts keng Active Directory keng PowerShell?
Search-ADAccount -AccountExpired

Makananu lang pantunan deng makalock a user accunts keng Active Directory keng PowerShell?
Search-ADAccount -LockedOut

Makananu yang pantunan ing SID na ning user account keng Active Directory keng PowerShell?
(Get-ADUser $user -Properties SID).SID.Value

Makananu yang gawang SID ing username keng Active Directory keng PowerShell?

Makananu yang gawang username ing SID keng Active Directory keng PowerShell?

Makananu yang kawani ing lagyu na ning user account keng Active Directory keng PoweShell?

Makananu yang pantunan ing petsa kung kapilan ya megawa ing metung user account keng Active Directory keng PowerShell?
Get-ADUser -Identity $user -Properties whenChanged, whenCreated | Format-List -Property whenChanged, whenCreated

Makananu yang palto ing opsyonal tsaka sapilitang properties para keng class a “User” keng Active Directory keng PowerShell?

Makananu yang akwa ing LDAP path para keng metung a user keng Active Directory keng PowerShell?

Makananu yang palitan ing CN (Canonical Name) para keng user keng Active Directory keng PowerShell?
Rename-ADObject $((Get-ADUser $user -Properties DistinguishedName).DistinguishedName) -NewName 'Steve Renard'

Makananu yang akwa ing Organizational Unit (OU) parent na ning metung a user keng Active Directory keng PowerShell?

Makananu yang akwa ing mikibandi keng user (ing ginawa keng account) keng Active Directory keng PowerShell?

Makananu yang gawang PwdLastSet para keng user keng Active Directory keng PowerShell?

Computers

Makananu yang subukan ing ligtas a channel keng pagitan na ning local computer tsaka ning domain keng PowerShell?
Test-ComputerSecureChannel

Makananu yang samasan ing ligtas a channel keng pagitan na ning local computer tsaka ning domain keng PowerShell?
Test-ComputerSecureChannel -Repair

Makananu yang ituknang ing account keng computer keng Active Directory keng PowerShell?
Disable-ADAccount $computer

Makananung mantun computers na ating eksaktung Operating Systems keng Active Directory keng PowerShell?

Organizational Unit (OU)

Makananung gawang Organizational Unit OU) keng Active Directory keng PowerShell?
New-ADOrganizationalUnit -Name 'STEVE' -Path 'DC=domain,DC=com'

Makananung manikwang detalyi ning Organizational Unit (OU) keng Active Directory keng PowerShell?
Get-ADOrganizationalUnit 'OU=STEVE,DC=domain,DC=com' -Properties *

Makananu yang palitan deskripsyun na ning Organizational Unit (OU) keng Active Directory keng PowerShell?
Set-ADOrganizationalUnit 'OU=STEVE,DC=domain,DC=com' -Description 'My description'

Makananu yang paganan/ituknang ing Organizational Unit (OU) nung eya saryang abura keng Active Directory keng PowerShell?

Makananu yang paganan ing e sadyang pamagbura para kareng egana ganang Organizational Unit (OU) keng Active Directory keng PowerShell?

Makananung mamurang Oraganizational Unit (OU) na protektadu ning e sadyang pamagbur keng Active Directory keng PowerShell?

Makananu yang gawang Canonical Name ing kawaning lagyu na ning Organizational Unit (OU) keng Active Directory keng PowerShell?

Makananu ang ilista reng alang laman a Oranizational Unit (OU) keng PowerShell?

Makananu yang kwanan ing manager na ning grupu keng PowerShell?
(Get-ADGroup $dn -Properties Managedby).Managedby

Up


Regex (Regular Expression)

Makananu yang palto ing IP address v4 (80.80.228.8) na atin Regex keng PowerShell?
$example = 'The IP address is 80.80.228.8'
$ip = [regex]::match($example,'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b').value

Makananu yang palto ing MAC address (C0-D9-62-39-61-2D) na atin “-” keng Regex keng PowerShell?
$example = 'The MAC address is C0-D9-62-39-61-2D'
$mac = [regex]::match($example,'([0-9A-F]{2}[-]){5}([0-9A-F]{2})').value

Makananu yang palto ing MAC address (C0:D9:62:39:61:2D) na atin “:” keng Regex keng PowerShell?
$example = 'The MAC address is C0:D9:62:39:61:2D'
$mac = [regex]::match($example,'((\d|([a-f]|[A-F])){2}:){5}(\d|([a-f]|[A-F])){2}').value

Makananu yang palto ing petsang (10/02/2015) keng Regex keng PowerShell?
$example = 'The date is 10/02/2015'
$date = [regex]::match($example,'(\d{2}\/\d{2}\/\d{4})').value

Makananu yang palto ing URL (www.powershell-guru.com) keng Regex keng PowerShell?
$example = 'The URL is www.powershell-guru.com'
$url = [regex]::match($example,'[a-z]+[:.].*?(?=\s)').value

Makananu yang palto ing email (user@domain.com) keng Regex keng PowerShell?
$example = 'The email is user@domain.com'
$email = [regex]::match($example,'(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b').value

Makananu yang palto ing “guru” ibat keng alimbawa na ning string keng Regex keng PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=-)(.*\n?)(?=.com)').value

Makananu yang palto ing “guru.com” ibat keng alimbawa na ning string keng Regex keng PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=-)(.*\n?)(?<=.)').value

Makananu yang palto ing “powershell-guru.com” ibat keng alimbawa na ning string keng Regex keng PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=www.)(.*\n?)').value

Makananu yang palto ing “123” ibat keng alimbawa na ning string keng Regex keng PowerShell?
$example = 'Powershell123'
[regex]::match($example,'(\d+)').value

Makananu yang palto ing “$” (simbulu na ning ddolyar) ibat keng alimbawa na ning string keng Regex keng PowerShell?
$example = 'Powershell`$123'
[regex]::match($example,'(\$)').value

Makananu yang palitang (*.fr) ing karakter a (*.com) keng metung a string keng Regex keng PowerShell?
$example = 'www.powershell-guru.com'
[regex]::Replace($example, '.com','.fr')

Makananung milako ing string keng Regex keng PowerShell?
[regex]::Escape('\\server\share')

Up


Memory

Makananu yang pilitang manipun memorya ing talatipun basura keng PowerShell?
[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()

Makananung akwa ing sukad na ning RAM na ning kompyuter keng PowerShell?

Up


Date

Makananu yang kunan ing kasalukuyang petsa keng PowerShell?
Get-Date
[Datetime]::Now

Makananu yan palto keng aliwa liwang klasing format ing petsa keng PowerShell?

Makananu yang gawang (String) a petsa ing (Datetime) a petsa keng PowerShell?
$datetimeToString = '{0:dd/MM/yy}' -f (Get-Date 30/01/2015)
$datetimeToString = (Get-Date 31/01/2015).ToShortDateString()

Makananu yang gawang (Datetime) a petsa ing (String) a petsa keng PowerShell?
$stringToDatetime = [Datetime]::ParseExact('30/01/2015', 'dd/MM/yyyy', $null)

Makananu yang nung makananu ya karagul ing diprensya (numeru ning aldo, oras, minutu, o segundu) keng pagitan da renng adwang petsa keng PowerShell?
(New-TimeSpan -Start $dateStart -End $dateEnd).Days
(New-TimeSpan -Start $dateStart -End $dateEnd).Hours
(New-TimeSpan -Start $dateStart -End $dateEnd).Minutes
(New-TimeSpan -Start $dateStart -End $dateEnd).Seconds

Makananu lang ikumpara keng PowerShell deng adwang petsa?
(Get-Date 2015-01-01) -lt (Get-Date 2015-01-30) # True
(Get-Date 2015-01-01) -gt (Get-Date 2015-01-30) # False

Makananu lang organisa reng hilerang petsa na “Datetime keng PowerShell?
$arrayDate | Sort-Object -Property {$_ -as [Datetime]}

Makananu yang umpisan o ituknang ing stopwatch keng PowerShell?
$chrono = [Diagnostics.Stopwatch]::StartNew()
$chrono.Stop()
$chrono

Makananu yang aakwa ing kasalukuyang aldo na ning dominggu keng PowerShell?
(Get-Date).DayOfWeek #Sunday

Makananu yang akwa ing petsa napun keng PowerShell?
(Get-Date).AddDays(-1)

Makananu yang akwa ing bilang na ning aldo keng metung a bulan (keng Pebreru 2015) keng PowerShell?
[DateTime]::DaysInMonth(2015, 2)

Makananung abalu ing leap year keng PowerShell?
[DateTime]::IsLeapYear(2015)

Makananung maglistang yime zone keng PowerShell?
[System.TimeZoneInfo]::GetSystemTimeZones()

Up


Networking

Makananung mag-encode (keng ASCII format) at madecode URL keng PowerShell?

Nanu la reng katumbas ng native network commands keng PowerShell?

Makananung manikwang IP address keng PowerShell?
Get-NetIPAddress # Windows 8.1 & Windows 2012
Get-NetIPConfiguration # Windows 8.1 & Windows 2012

Makananu yang ituknang ing IP address v6 (IPv6) keng PowerShell?

Makananu yang sigradwan ing IP address v4 (IPv4) keng PowerShell?
if([ipaddress]'10.0.0.1'){'validated'}

Makananu yang pantunan ig external IP address keng PowerShell?

Makananung mantun Hostname ibat keng IP address keng PowerShell?
([System.Net.Dns]::GetHostEntry($IP)).Hostname

Makananung mantun IP address ibat keng Hostname keng PowerShell?
([System.Net.Dns]::GetHostAddresses($computer)).IPAddressToString

Makananung mantun FQDN ibat keng Hostname keng PowerShell?
[System.Net.Dns]::GetHostByName($computer).HostName

Makananung mantun network configuration (Ip, Subnet, Gateway, and DNS) keng PowerShell?

Makananung mantun MAC address keng PowerShell?
Get-CimInstance win32_networkadapterconfiguration | Select-Object -Property Description, Macaddress
Get-WmiObject -Class win32_networkadapterconfiguration | Select-Object -Property Description, Macaddress

Makananu yang patunugan ing kompyuter keng PowerShell?

Makananu yang lawen nung makakonekta ya keng internet ing kompyuter keng PowerShell?

Makananung gawang “whois” lookup para keng website keng PowerShell?
$whois = New-WebServiceProxy 'http://www.webservicex.net/whois.asmx?WSDL'
$whois.GetWhoIs('powershell-guru.com')

Makananung manikwang detalyi na ing pampublikung IP (Geolocation) keng PowerShell?

Makananung lawen nung makabuklat o makasara ya ing saksakan keng PowerShell?
New-Object -TypeName Net.Sockets.TcpClient -ArgumentList $computer, 135

Makananung magtracert keng PowerShell?
Test-NetConnection www.google.com -TraceRoute

Makananu yang samasan ing home network connection profile keng PowerShell?
Get-NetAdapter | Format-Table -Property Name, InterfaceDescription, ifIndex -AutoSize # Windows 8.1
Set-NetConnectionProfile -InterfaceIndex 6 -NetworkCategory Private

Makananu yang pakit ing saksakang TCP keng PowerShell?
netstat.exe -ano
Get-NetTCPConnection #Windows 8 and 2012

Makananu yang palatyan ing makabang URL keng malating URL keng PowerShell?
$url = 'www.powershell-guru.com'
$tiny = Invoke-RestMethod -Uri "http://tinyurl.com/api-create.php?url=$url"

Makananung manikwang proxy settings keng PowerShell?
Get-ItemProperty -Path HKCU:"Software\Microsoft\Windows\CurrentVersion\Internet Settings"

DNS

Makananu yang lawen ing DNS cache ning lokal a kompyuter keng PowerShell?
ipconfig.exe /displaydns
Get-DnsClientCache #Windows 8 and 2012

Makananu lang lako reng cache keng DNS na ning lokal a kompyuter keng PowerShell?
ipconfig.exe /flushdns
Start-Process -FilePath ipconfig -ArgumentList /flushdns -WindowStyle Hidden
Clear-DnsClientCache #Windows 8 and 2012

Makananu lang lako reng cache keng DNS naning remote a kompyuter keng PowerShell?
Invoke-Command -ScriptBlock {Clear-DnsClientCache} -ComputerName computer01, computer02

Makananu yang basan ing Hosts file keng PowerShell?
Get-Content -Path 'C:\Windows\system32\drivers\etc\hosts'

Up


Password

Makananung gawang miyaliwang password keng PowerShell?
[Reflection.Assembly]::LoadWithPartialName('System.Web')
[System.Web.Security.Membership]::GeneratePassword(30,2)

Makananu yang palitan ing lokal a password para keng administrator keng remote server keng PowerShell?
$admin = [ADSI]('WinNT://server01/administrator,user')
$admin.SetPassword($password)
$admin.SetInfo()

Makananu yang pantunan ing petsa ning expiration na ning account keng Active Directory keng PowerShell?

Up


Printers

Makananu lang ilista reng egana ganang printers para keng eksaktung server keng PowerShell?
Get-WmiObject -Query 'Select * From Win32_Printer' -ComputerName $computer

Makananu lang ilista reng egana ganang saksakan para keng eksaktung server keng PowerShell?
Get-WmiObject -Class Win32_TCPIPPrinterPort -Namespace 'root\CIMV2' -ComputerName $computer

Makananu yang palitang ing komentu o lokasyun na ning printer keng PowerShell?

Makananu lang ituknang deng egana ganang obra na ning printer keng PowerShell?
$printer = Get-WmiObject -Class win32_printer -Filter "Name='HP Deskjet 2540 series'"
$printer.CancelAllJobs()

Makananung magprint test page para keng printer keng PowerShell?
$printer = Get-WmiObject -Class win32_printer -Filter "Name='HP Deskjet 2540 series'"
$printer.PrintTestPage()

Makananung manikwang makapanayang print para keng printers keng PowerShell?

Up


Regedit

Read

Makananung maglistang registry hives keng PowerShell?
Get-ChildItem -Path Registry::

Makananung manikwang ulaga na ning registry at klasi da reng ulaga keng PowerShell?

Makananung maglistang registry key subkeys keng PowerShell?

Makananung maglistang registry key subkeys keng mumulit a paralan keng PowerShell?
Get-ChildItem -Path 'HKLM:\SYSTEM' -Recurse -ErrorAction SilentlyContinue

Makananung mantun subkeys na atin eksaktung lagyu keng PowerShell?
Get-ChildItem -Path 'HKLM:\SOFTWARE' -Include *Plugin* -Recurse -ErrorAction SilentlyContinue

Makananu yang ibalik ing lagyu na ning registry subkeys keng PowerShell?
(Get-ChildItem -Path 'HKLM:\SYSTEM').Name # Return HKEY_LOCAL_MACHINE\SYSTEM\ControlSet
Get-ChildItem -Path 'HKLM:\SYSTEM' -Name # Return ControlSet

Makananu yang ilista ing ulaga na ning registry keng PowerShell?
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'

Makananu yang basan ing eksaktung ulaga na ning registry keng PowerShell?
(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ProductName

Makananung mamasang eksaktung ulaga na ning registry keng remote computer keng PowerShell?

Write

Makananung awang bayung registry key keng PowerShell?
New-Item -Path 'HKCU:\Software\MyApplication'

Makananung gawang bayung registry value keng PowerShell?
New-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version' -Value '1.0'

Makananung baywan ing kasalukuyang registry value keng PowerShell?
Set-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version' -Value '2.0'

Delete

Makananung mamurang registry value keng PowerShell?
Remove-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version'

Makananung mamurang registry key keng PowerShell?
Remove-Item -Path 'HKCU:\Software\MyApplication' -Force

Test

Makananu mung abalu nung ing metung a registry key atsu ya keng PowerShell?
Test-Path -Path 'HKCU:\Software\MyApplication'

Makananu mung abalu nung ing metung a registry value atsu ya keng PowerShell?
(Get-Item -Path 'HKCU:\Software\MyApplication').GetValueNames() -contains 'Version'

Up


Strings

Makananung maglako white-space a a karakter ibat keng umpisa na ning string keng PowerShell?
$string = ' PowershellGuru'
$string = $string.TrimStart()

Makananung maglako white-space a a karakter ibat keng talwi na ning string keng PowerShell?
$string = 'PowershellGuru '
$string = $string.TrimEnd()

Makananung maglako white-space a a karakter ibat keng umpisa at talwi na ning string keng PowerShell?
$string = ' PowershellGuru '
$string = $string.Trim()

Makananu yang gawang maragul a letra ing string keng PowerShell?
$string = 'powershellguru'
$string = $string.ToUpper()

Makananu yang gawang malating letra ing string keng PowerShell?
$string = 'POWERSHELLGURU'
$string = $string.ToLower()

Makananu yang palitan ing substring a “PowerShell” na ning string a “PowerShellGuru” keng PowerShell?
$string.Substring(0,10)

Makananu yang pilinan ing substring a “Guru” na ning string a “PowerShellGuru” keng PowerShell?
$string.Substring(10)

Makananu yang pilinan ing numerung “123” na ning “PowerShell123Guru” keng PowerShell?
$string = 'Powershell123Guru'
[regex]::match($string,'(\d+)').value

Makananu yang ing zero-based idex na ning “Guru” na ning string a “PowerShellGuru” keng PowerShell?
$string.IndexOf('Guru') # 10

Makananu yang lawen nung ala yang laman ing string keng PowerShell?
$string = $null
$string = ''
[string]::IsNullOrEmpty($string)

Makananu yang lawen nung ala yang laman o white-space characters mu ing laman na ning string keng PowerShell?
$string = $null
$string = ''
$string = ' '
[string]::IsNullOrWhiteSpace($string)

Makananung lawaen nung letra ing laman na ning string keng PowerShell?
$string = 'PowershellGuru'
$string.Contains('s')
[regex]::match($string,'s').Success

Makananu yang ibalik ing sukad na ning string keng PowerShell?
$string.Length

Makananu lang pidugtung deng adwang string keng PowerShell?

Makananu yang iparis ing metung o igit pang brackets “[ ]” ning string keng PowerShell?
$string = '[PowershellGuru]'
$string -match '\[' # Only 1
$string -match '\[(.*)\]' # Several

Makananu yang iparis ing metung o igit pang perentheses “( )” ning string keng PowerShell?
$string = '(PowershellGuru)'
$string -match '\(' # Only 1
$string -match '\((.*)\)' # Several

Makananu yang iparis ing metung o igit pang curly brackets “{ }” ning string keng PowerShell?
$string = '{PowershellGuru}'
$string -match '\{' # Only 1
$string -match '\{(.*)\}' # Several

Makananu yang iparis ing metung o igit pang angle brackets “< >” ning string keng PowerShell?
$string = ''
$string -match '\<' # Only 1
$string -match "\<(.*)\>" # Several

Makananu yang iparis ing anggang nanung malating letra (abc) keng metung a string keng PowerShell?
$string = 'POWERSHELLGURU'
$string -cmatch "^[a-z]*$" #False

Makananu yang iparis ing anggang nanung maragul a letra (ABC) keng metung a string keng PowerShell?
$string = 'powershellguru'
$string -cmatch "^[A-Z]*$" #False

Makananu yang iparis in “[p” (p a malating letra) na ning string keng PowerShell?
$string = '[powershellGuru]'
$string -cmatch '\[[a-z]\w+' #True

Makananu yang iparis ing “[P” (P maragul a letra) na ning string keng PowerShell?
$string = '[PowershellGuru]'
$string -cmatch '\[[A-Z]\w+' #True

Makananu yang palitan ing line keng metung ang line keng PowerShell?
$a = 'Line A'
$b = 'Line B'
$a = $a -replace $a, $b

Makananu yang palitang ing division operation keng string (porsyentu) keng PowerShell?
(1/2).ToString('P')

Makananu lang samasan reng strings na atin laman a numeru keng PowerShell?

Makananu yang pilinan ing talwing salita na ning sentence keng PowerShell?
$sentence = 'My name is Steve Renard'
$sentence.Split(' ')[-1] # Returns Renard

Makananu yang kunan ing pekamaraul a salita na ning sentence keng PowerShell?
$sentence = 'My name is Steve Renard'
$sentence.Split(' ') | Sort-Object -Property Length | Select-Object -Last 1 # Returns Renard

Makananu yang abalu kung pilan yang besis meulit ing string keng metung a sentence keng PowerShell?
$sentence = 'steve steve steve renard'
[regex]::Matches($sentence, 'steve').Count # Returns 3

Makananu lang kopyan deng bawat karakter na ning string keng hilera da reng karekter keng PowerShell?

Makananu yang gawang maragula a letra ing mumunang letra na ning string keng PowerShell?

Makananu yang lage (kayli o wanan) ing string keng PowerShell?

Makananung mag-encode o magdecode string keng Base64 keng PowerShell?

Makananung mamalit numeru (papunta at pabalik) keng binary keng PowerShell?

Makananu yang ibalik mu ing talwing parent folder keng dalan keng PowerShell?

Makananu yang ibalik mu ing talwing bage keng dalan keng PowerShell?

Up


Math

Makananu lang ilista reng paralan na ning System.Math class keng PowerShell?
[System.Math] | Get-Member -Static -MemberType Method

Makananu yang ibalik ing absolute value keng PowerShell?
[Math]::Abs(-12) #Returns 12
[Math]::Abs(-12.5) # Returns 12.5

Makananu yang ibalik ing anggulu kung nokarin ing sine ing numeru keng PowerShell?
[Math]::ASin(1) #Returns 1,5707963267949

Makananu yang ibalik ing ceiling value keng PowerShell?
[Math]::Ceiling(1.4) #Returns 2
[Math]::Ceiling(1.9) #Returns 2

Makananu yang ibalik ing floor value keng PowerShell?
[Math]::Floor(1.4) #Returns 1
[Math]::Floor(1.9) #Returns 1

Makananu yang ibalik ing natural (base e) keng logarithm na ning numeru keng PowerShell?
[Math]::Log(4) #Returns 1,38629436111989

Makananu yang ibalik ing base 10 logarithm na ning numeru keng PowerShell?
[Math]::Log10(4) #Returns 0,602059991327962

Makananu yang ibalik ing pekamatas a adwang values keng PowerShell?
[Math]::Max(2,4) #Returns 4
[Math]::Max(-2,-4) #Returns -2

Makananu yang ibalik ing pekamalating adwang values keng PowerShell?
[Math]::Min(2,4) #Returns 2
[Math]::Max(-2,-4) #Returns -4

Makananu yang ibali ing numerung makaraise keng metung a power keng PowerShell?
[Math]::Pow(2,4) #Returns 16

Makananu yan ibalik ing decimal value na ing pekamalapit a ulaga na ning integral keng PowerShell?
[Math]::Round(3.111,2) #Returns 3,11
[Math]::Round(3.999,2) #Returns 4

Makananu yang ibalik ing parting integral na ning metung a numerung decimal keng PowerShell?
[Math]::Truncate(3.111) #Returns 3
[Math]::Truncate(3.999) #Returns 3

Makananu yang ibalik ing square root na ning metung a numeru keng PowerShell?
[Math]::Sqrt(16) #Returns 4

Makananu yang ibalik ing PI constant keng PowerShell?
[Math]::Pi #Returns 3,14159265358979

Makananu yang ibalik ing natural logarithmic base (constant e) keng PowerShell?
[Math]::E #Returns 2,71828182845905

Makananu yang lawen nung odd ya o even ya ing metung a numeru keng PowerShell?
[bool]($number%2)

Up


Hashtables

Makananung gawang alang laman a hashtable keng PowerShell?
$hashtable = @{}
$hashtable = New-Object -TypeName System.Collections.Hashtable

Makananung gawang hashtable gamit ing items keng PowerShell?

Makananung gawang hashtable na makaayus agpang keng key/lagyu (makaayus a diksyuaryu) keng items keng PowerShell?

Makananung magdagdag items (paris a key-value) keng hashtable keng PowerShell?
$hashtable.Add('Key3', 'Value3')

Makananung manikwang metung a ulaga na ning hashtable keng PowerShell?
$hashtable.Key1
$hashtable.Get_Item('Key1')

Makananung manikwang pekamalating ulaga na ning hashtable keng PowerShell?

Makananung manikwang pekamaragul a ulaga na ning hashtable keng PowerShell?

Makananu yang palitan ing items na ning hashtable keng PowerShell?
$hashtable.Set_Item('Key1', 'Value1Updated')

Makananung maglakong items keng hashtable keng PowerShell?
$hashtable.Remove('Key1')

Makananu yang lako laman ing hashtable keng PowerShell?
$hashtable.Clear()

Makananu yang abalu nung atsu ya ing metung a key/value na ning hashtable keng PowerShell?
$hashtable.ContainsKey('Key3')
$hashtable.ContainsValue('Value3')

Makananu yang samasan agpang keng key/value na ning hashtable keng PowerShell?
$hashtable.GetEnumerator() | Sort-Object -Property Name
$hashtable.GetEnumerator() | Sort-Object -Property Value -Descending

Up


Arrays

Makananung gawang alang laman a hilera keng PowerShell?
$array = @()
$array = [System.Collections.ArrayList]@()

Makananung gawang hilera da reng items keng PowerShell?
$array = @('A', 'B', 'C')
$array = 'A', 'B', 'C'
$array = 'a,b,c'.Split(',')
$array = .{$args} a b c
$array = echo a b c

Makananung magdagdag items keng metung hilera keng PowerShell?
$array += 'D'
[void]$array.Add('D')

Makananu yang baywan ing item keng metung a hilera keng PowerShell?
$array[0] = 'Z' # 1st item[0]

Makananu yang lawen ing sukad na ning hilera keng PowerShell?
$array = 'A', 'B', 'C'
$array.Length # Returns 3

Makananu yang bawan ing metung a item/mapilan/eganagan na ning hilera keng PowerShell?
$array = @('A', 'B', 'C')
$array[0] # One item (A)
$array[0] + $array[2] # Several items (A,C)
$array # All items (A,B,C)

Makanu yang lako ing item a alang laman keng hilera keng PowerShell?
$array = @('A', 'B', 'C', '')
$array = $array.Split('',[System.StringSplitOptions]::RemoveEmptyEntries) | Sort-Object # A,B,C

Makananu yang lawen nung atsu ya ing item keng hilera keng PowerShell?
$array = @('A', 'B', 'C')
'A' | ForEach-Object -Process {$array.Contains($_)} # Returns True
'D' | ForEach-Object -Process {$array.Contains($_)} # Returns False

Makananu yang pantunan inf index number na ning item keng hilera keng PowerShell?
$array = @('A', 'B', 'C')
[array]::IndexOf($array,'A') # Returns 0

Makananu yang baligtaran ing pangaayus na ning item keng metung a hilera keng PowerShell?
$array = @('A', 'B', 'C')
[array]::Reverse($array) # C,B,A

Makananung gawang maski nanung item a ibat keng hilera keng PowerShell?
$array | Get-Random

Makananu yang samasan ing hilera keng patas/pababang paralan keng PowerShell?
$array = @('A', 'B', 'C')
$array | Sort-Object # A,B,C
$array | Sort-Object -Descending # C,B,A

Makananu yang bilangan ing items na ning hilera keng PowerShell?
$array.Count

Makananung magdagdag hilera keng metung pang hilera keng PowerShell?
$array1 = 'A', 'B', 'C'
$array2 = 'D', 'E', 'F'
$array3 = $array1 + $array2 # A,B,C,D,E,F

Makananung mantun kopya ibat keng metung a hilera keng PowerShell?
$array = 'A', 'B', 'C', 'C'
($array | Group-Object | Where-Object -FilterScript {$_.Count -gt 1}).Values # Returns C

Makananung maglakong kopya ibat keng metung a hilera keng PowerShell?
$array = 'A', 'B', 'C', 'C'
$array = $array | Select-Object -Unique
$array # Returns A,B,C

Makananung gawang hilera na atin items a magumpisa keng preffix (“user01″,”user01″,…”user10”) keng PowerShell?
$array = 1..10 | ForEach-Object -Process { "user$_" }

Up


ACL

Makananu lang ilista reng ALC na ning AD user keng PowerShell?
(Get-Acl -Path "AD:\$dn").Access

Makananu yang ilista ing ACL na ning folder keng PowerShell?
(Get-Acl -Path C:\scripts).Access

Makananu lang ilista reng permission entries na ning ACL (users o reng grupu) naa ning metung a AD user keng PowerShell?

Up


Variables

Nanu la reng maralas a data types keng PowerShell?

Makananu yang pantunan ing pekamalati at pekamaragul a value para kareng mapilan a type da reng variables keng PowerShell?

Makananu yang subukan ing datatype keng PowerShell?

Makananung gawang Here-String variable keng PowerShell?

Makananung gawang variable keng PowerShell?
$powershellGuru = 'Hello'

Makananung gawang constant variable keng PowerShell?
Set-Variable -Name powershellGuru -Value 2015 -Option Constant

Makananung gawang global variable keng PowerShell?
$Global:powershellGuru = 'Hello'

Makananung mamasang variable keng PowerShell?
$powershellGuru = 'Hello' # Create
$powershellGuru # Read
Get-Variable -Name powershellGuru -ValueOnly # Read

Makananu yang lawen ing klsi na ning variable keng PowerShell?
$powershellGuru.GetType()

Makananung mantun variables keng global scope keng PowerShell?
Get-Variable -Scope Global

Makananung manikwang variables agpang keng lagyu keng PowerShell?
Get-Variable -Include *Preference -Exclude W*

Makananung magtalagang data type keng variable keng PowerShell?
[int64]$variable = 100
[string]$variable = 'PowershellGuru'

Makananu lang umpisan paganan reng marakal a variable keng pareung value keng PowerShell?
$a = $b = $c = $d = $e = 0

Nanu ya ing alyas para keng variable a “$_” keng PowerShell?
Get-Process | Where-Object -FilterScript {$_.Handles -gt 1000} # Using $_
Get-Process | Where-Object -FilterScript {$PSItem.Handles -gt 1000} # Using $PSItem (since version 3)

Makananu lang ilako reng variables na atin lagyung magumpisa keng “count” keng PowerShell?
Remove-Variable -Name count*

Makananu yang akwa ing lokal a paligid na ning variable keng PowerShell?
Get-ChildItem -Path Env:

Makananu yang akwa ing linya na ning Path Environment Variable agpang keng linya keng PowerShell?
($env:Path) -replace(';', "`n")
[Environment]::GetEnvironmentVariable('Path') -replace(';', "`n")

Makananung manikwang bayung path (alimbawa C:SysinternalsSuite) keng Path Environment Variable keng PowerShell?
$env:Path += ';C:\SysinternalsSuite'
$env:Path = $env:Path + ';C:\SysinternalsSuite'

Makananu lang pirugtung deng variables keng PowerShell?
$a = 'Powershell'
$b = '- Guru'
$c = $a + $b

Makananu yang gamitan ing ErrorVariable keng PowerShell?
Get-ChildItem -Path 'C:\PerfLogs' -ErrorAction SilentlyContinue -ErrorVariable AccessDenied
$AccessDenied | ForEach-Object -Process {$_.Exception}
$AccessDenied | ForEach-Object -Process {$_.TargetObject}

Makananu yang paganan/ituknang ing katumbas na ning “Option Explicit” (VBScript: kaylangan medeklara ya ing variable) keng PowerShell?

Up


Static .NET Methods

Makananung manikwang myembrung static keng PowerShell?
[DateTime] | Get-Member -Static

Up


Sounds

Makananu yang iplay ing tunug “beep” keng PowerShell?
[System.Console]::Beep()

Makanananu yang iplay ing tunug a “asterisk” keng PowerShell?
[System.Media.SystemSounds]::Asterisk.Play()

Makananu yang iplay ing tunug a “exclamation” keng PowerShell?
[System.Media.SystemSounds]::Exclamation.Play()

Makananung manikwang tunug keng PowerShell?
[System.Media.SystemSounds] | Get-Member -Static

Makananu ang iplay ing tunug a “WAV” keng PowerShell?
$soundPlayer = New-Object -TypeName System.Media.SoundPlayer -ArgumentList "$env:windir\Media\Ringout.wav"
$soundPlayer.Play()
o
$soundPlayer.PlayLooping()
$soundPlayer.Stop()

Makananu yang paganan ing speech written text keng PowerShell?
Add-Type -AssemblyName System.Speech
$speech = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$speech.Speak('Hello PowershellGuru')

Up


XML

Makananu yang basan ing XML file keng PowerShell?
[xml]$sitemap = Get-Content -Path .\sitemap.xml
$sitemap.urlset.url

Makananu yang ikalakal ing XML file keng PowerShell?
Get-Process | Export-Clixml -Path C:\scripts\processes.xml

Makananu manangkat data ibat keng CLIXML file keng PowerShell?
$importProcesses = Import-Clixml -Path C:\scripts\processes.xml

Up


GUI

Makananung gawang simpling GUI (Windows Form) keng PowerShell?

Up


Characters

Makananu yang gawang karakter ing ASCII value keng PowerShell?
[char]64

Makananu yang gawang ASCII value ing karakter keng PowerShell?
[int][char]'@'

Makananung gawang letrang Inglis keng PowerShell?
[char[]](97..122)

Up


Compare

Makananu lang pikumpara reng adwang hilera keng PowerShell?

Makananu lang pikumpara reng adwang prosesu keng PowerShell?

Up


Microsoft Exchange

Makananu lang ibalik deng listaan da reng mobile device na makasynchronize keng mailbox na ning user keng PowerShell?
Get-ActiveSyncDeviceStatistics

Makananung mangabit “Full Access” a permisyun keng mailbox para keng user keng PowerShell?
Add-MailboxPermission -Identity $dn -User 'DOMAIN\powershellguru' -AccessRights 'FullAccess'

Makananung maglako “Full Access” a permisyun keng mailbox para keng user keng PowerShell?
Remove-MailboxPermission -Identity $dn -User 'DOMAIN\powershellguru' -AccessRights 'FullAccess' -InheritanceType 'All'

Makananung mangabit “Send As” a permisyun keng mailbox para keng user keng PowerShell?
Add-ADPermission -Identity $dn -User 'DOMAIN\powershellguru' -ExtendedRights 'Send-As'

Makananung maglako “Send As” a permisyun keng mailbox para keng user keng PowerShell?

Makanu yang pantunan ing inbox rules ibat keng mailbox keng PowerShell?
Get-InboxRule -Mailbox 'Powershell.Guru'

Makananu yang kunan ing SMIP address para keng user na ating OWA (Outlook Web Access) na gagana keng PowerShell?
Get-CASMailbox -Filter{OWAEnabled -eq $true} | Select-Object -Property Name, PrimarySMTPAddress

Exchange 2007

Makananu lang iinstall deng kaylangan para keng server a Exchaange Server 2007 Hub Transport, Mailbox (MBX), tsaka Client Access Server (CAS) keng PowerShell?

Exchange 2010

Makananu lang iinstall deng kaylangan para keng server a Exchaange Server 2010 Hub Transport, Mailbox (MBX), tsaka Client Access Server (CAS) keng PowerShell?

Exchange 2013

Makananu lang iinstall deng kaylangan para keng server a Exchaange Server 2013 Hub Transport, Mailbox (MBX), tsaka Client Access Server (CAS) keng PowerShell?

Makananu lang iinstall deng kaylangan para keng server a Exchaange Server 2013 Client Access Server (CAS) keng PowerShell?

Up


Microsoft Excel

Makananu lang ikalakal tsaka iautofit deng column keng excel file keng PowerShell?

Makananu yang lawen nung maka-install ya ing bersyun na ning Microsoft Office keng PowerShell?
$excel = New-Object -ComObject Excel.Application
$excel.Version

Up


Errors

Makananu la ngan ilako reng “Error” keng sistema na ning variable keng PowerShell?
$Error.Clear()

Makananu yang akwa ing talwing iwalay a pamagkamali keng PowerShell?
$Error[0].Exception.GetType().FullName

Makananu la ngan ilista reng exception types keng PowerShell?

Up


PSObject

Makananung gawang pasadyang bage keng PowerShell?

Up


Openfiles

Makananu lang ilista reng makabuklat a files keng PowerShell?

Up


Search

Makananung mantun files keng PowerShell?