AJUJU UGBORO POWERSHELL NA ASUSU IGBO

By | May 18, 2015

translated-igbo


beta-v2-0


Echiche : Otụtụ ugboro jụrụ ajụjụ banyere PowerShell.

Ị nwere ike iji nke a ndepụta na ụzọ dị iche iche :

  • Ka idetuo / mado iwu n’ime a edemede
  • Iji hụ ngwa ngwa syntax nke a kpọmkwem iwu
  • Gị ka mma oru ihe ọmụma
  • Na-achọpụta iwu
  • Iji kwadebe a ọrụ N’ajụjụ ọnụ

Emelitere
July 02, 2015
Chepụtara Steve Renard
Isi Iyi igbo.powershell-guru.com
Udi
75
Ajụjụ
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

Otú iji chọpụta mbipụta nke PowerShell?

Olee otú na-agba PowerShell ọzọ mbipụta maka azụ ndakọrịta?
powershell.exe -Version 2.0

Olee otú na-achọ a ntakiri PowerShell mbipụta (3.0 na elu) na a akwukwọ na PowerShell?
#Requires -Version 3.0

Olee otú na-achọ nhazi ùgwù n’ihi na a akwukwọ na PowerShell?

Olee otú ịlele oke nke a akwukwọ na PowerShell?
help -Name .\Get-ExchangeEnvironmentReport.ps1 -Full

Esi ọmụma maka ugbu a ọrụ na PowerShell?
[Security.Principal.WindowsIdentity]::GetCurrent()

Otú ike, dezie, na bubatagharịa a profaịlụ PowerShell?

Olee otú ime a kwusi nke 5 sekọnd / nkeji na a akwukwọ na PowerShell?
Start-Sleep -Seconds 5
Start-Sleep -Seconds 300 # 5 minutes

Esi ikpeazụ oge buut na PowerShell?
(Get-CimInstance -ClassName win32_operatingsystem).LastBootUpTime

Esi ụdị ome osooso na PowerShell?

Olee otú depụta mmalite omume na PowerShell?

Olee otú iwepụ ihe ngwa na PowerShell?

Olee otú na nseta ihuenyo nke dum desktọọpụ ma ọ bụ nke na-arụsi ọrụ windo na PowerShell?
Take-ScreenShot -Screen -File 'C:\scripts\screenshot.png' -Imagetype JPEG
Repository : Take-ScreenShot

Esi ozi ọnụ maka MSMQ kwụ n’ahịrị na PowerShell?

Olee ka na-egbu iwu na PowerShell?

Otú ike a na bepụ na PowerShell?

Olee otú tụgide ma ọ bụ iwepụ a omume ka mgbochi ọrụ na PowerShell?

Olee otú imeghe a Windows Explorer na PowerShell?
[Diagnostics.Process]::Start('explorer.exe')
Invoke-Item -Path C:\Windows\explorer.exe

Olee otú depụta ngwaọrụ ọkwọ ụgbọala na PowerShell?
Get-WmiObject -Class Win32_PnPSignedDriver
Get-WindowsDriver -Online -All
driverquery.exe

Otú ike a GUID na PowerShell?

Esi na ọnọdụ nke nwa oge ndekọ maka ugbu a ọrụ na PowerShell?
[System.IO.Path]::GetTempPath()

Olee otú isonyere a ụzọ na nwa ụzọ n’ime otu ụzọ na PowerShell?
Join-Path -Path C:\ -ChildPath \windows

Olee otú depụta niile cmdlets “Were- *” na PowerShell?
Get-Command -Verb Get

Olee otú depụta pụrụ iche na usoro nchekwa na PowerShell?

Olee otú efego ISO / VHD faịlụ na PowerShell?
Mount-DiskImage 'D:\ISO\file.iso' # ISO
Mount-DiskImage 'D:\VHD\file.vhd' # VHD

Olee otú elele NET Okpokoro nsụgharị arụnyere na PowerShell?

Olee otú elele ma ọ bụrụ na NET Okpokoro mbipụta 4.5 arụnyere na PowerShell?
(Get-ItemProperty -Path 'HKLM:\Software\Microsoft\NET Framework Setup\NDP\v4\Full' -EA 0).Version -like '4.5*'

Olee ka na-amalite na-akwụsị a ndekọ (ike a ndekọ nke Windo PowerShell nnọkọ) na PowerShell?
Start-Transcript -Path 'C:\scripts\transcript.txt
Stop-Transcript

Olee otú ịgbanwe ugbu a ndekọ na a kpọmkwem na PowerShell?
Set-Location -Path 'C:\scripts'

Olee ka ikpochapụ ihuenyo na PowerShell?
Clear-Host
cls # Alias

Olee otú ịgbanwe ngosi mkpebi na PowerShell?
Set-DisplayResolution -Width 1280 -Height 1024 -Force # Windows 2012

Olee otú ịtọ “ihuenyo zuru” windo na PowerShell?
mode.com 300

Oole otu akụkụ (obosara na ịdị elu) nke a foto na PowerShell?

Esi na Windo ngwaahịa isi na PowerShell?

Perfmon

Esi na nke ugbu a “% Oge isi etiti” (nkezi) ke ikpeazụ 5 sekọnd (ugboro 10) na PowerShell?
(Get-Counter '\Processor(_total)\% Processor Time' -SampleInterval 5 -MaxSamples 10).CounterSamples.CookedValue

Assemblies

Olee otú iji mara mgbakọ na PowerShell?

Olee otú elele ugbu a NET mgbakọ kwajuru na PowerShell?

Olee otú ịchọta GAC ​​(Uwa Nzukọ Ngwaahịa) ụzọ na PowerShell?

Clipboard

Olee otú idetuo n’ihi ka Osisi oge na PowerShell?

Esi ọdịnaya nke osisi oge na PowerShell?
Add-Type -AssemblyName PresentationCore
[Windows.Clipboard]::GetText()

Hotfixes

Esi na idozi ọku arụnyere na PowerShell?
Get-HotFix -ComputerName $computer

Esi na idozi ọku arụnyere tupu / mgbe a kpọmkwem ụbọchị na PowerShell?
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

Olee otú lelee ma ọ bụrụ a idozi ọkuarụnyere na PowerShell?
Get-HotFix -Id KB2965142

Esi na idozi ọku arụnyere na a na n’ime ime obodo na kọmputa na PowerShell?
Get-HotFix -ComputerName $computer

Pagefile

Esi Peejifaịlụ ọmụma na PowerShell?
Get-WmiObject -Class Win32_PageFileusage | Select-Object -Property Name, CurrentUsage, AllocatedBaseSize, PeakUsage, InstallDate

Esi na-atụ aro saiz (MB) maka Peejifaịlụ na PowerShell?
[Math]::Truncate(((Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory) / 1MB) * 1.5

Otú ike a Peejifaịlụ (4096 MB) na (D 🙂 ụgbọala nke na-PowerShell?

Olee otú ihichapụ a Peejifaịlụ na (C 🙂 ụgbọala nke na-PowerShell?

Maintenance

Olee otú ịlele itisa nke a mbanye na PowerShell?

Olee otú ịlele disk ohere nke draịva na PowerShell?

Up


Files

Olee otú imeghe a faịlụ na PowerShell?
Invoke-Item -Path 'C:\scripts\file.txt'
.'C:\scripts\file.txt'

Olee otú ịgụ faịlụ na PowerShell?
Get-Content -Path 'C:\scripts\file.txt'
gc "C:\scripts\file.txt" # Alias

Olee otú dee mmeputa a faịlụ na PowerShell?
'Line1', 'Line2', 'Line3' | Out-File -FilePath 'C:\scripts\file.txt'
'Line1', 'Line2', 'Line3' | Add-Content -Path file.txt

Esi na aha n’uju nke ugbu a akwukwọ faịlụ na PowerShell?
$MyInvocation.MyCommand.Path

Olee otú mpikota onu / zip faịlụ na PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::CreateFromDirectory($folder,$fileZIP)

Olee otú bụghị mpikota onu / bụghị zip faịlụ na PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::ExtractToDirectory($fileZIP, $folder)

Olee otú ịhụ faịlụ na a ZIP ebeidoteihe na PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::OpenRead($fileZIP)

Olee otú gosipụta saiz nke a faịlụ na KB na PowerShell?
(Get-ChildItem -Path .\winsrv.dll).Length /1KB
(Get-ChildItem -Path .\winsrv.dll).Length /1MB
(Get-ChildItem -Path .\winsrv.dll).Length /1GB

Esi achọta faịlụ ibu ma ọ bụ ihe na-erughị 1 GB na PowerShell?

Olee otú na-egosipụta aha a faịlụ na-enweghị ndọtị na PowerShell?
[System.IO.Path]::GetFileNameWithoutExtension('C:\Windows\system32\calc.exe') # Return calc

Olee otú gosipụta ndọtị nke a faịlụ na PowerShell?
[System.IO.Path]::GetExtension('C:\scripts\file.txt') # Return .txt

Esi faịlụ mbipụta nke a faịlụ na PowerShell?

Esi na hash nke a faịlụ na PowerShell?
(Get-FileHash $file).Hash

Esi na MD5 / SHA1 elelenchikota nke a faịlụ na PowerShell?
Get-FileHash $file -Algorithm MD5
Get-FileHash $file -Algorithm SHA1

Olee otú na-egosipụta zoro ezo faịlụ na PowerShell?

Olee otú lelee ma ọ bụrụ na otu faịlụ nwere ndọtị na PowerShell?

Olee ka a faịlụ dị ka “Gụọ nanị” na PowerShell?
Set-ItemProperty -Path .\file.txt -Name IsReadOnly -Value $true

Olee otú ịgbanwe “IkpeazụDeeOge” Nyenụ urua maka otu faịlụ na PowerShell?
Set-ItemProperty -Path .\file.txt -Name LastWriteTime -Value ((Get-Date).AddDays(-7))
If not working, use Nirsoft tool: BulkFileChanger.

Olee otú ike ọhụrụ faịlụ na PowerShell?
New-Item -ItemType File -Path 'C:\scripts\file.txt' -Value 'FirstLine'

Olee otú nyegharịa a faịlụ na PowerShell?
Rename-Item -Path 'C:\scripts\file.txt' -NewName 'C:\scripts\powershellguru2.txt'

Olee ka nnukwu / ogbe nyegharịa otutu faịlụ na PowerShell?
Get-ChildItem -Path C:\scripts\txt | Rename-Item -NewName { $_.Name -replace ' ', '_' }

Olee otú ihichapụ a faịlụ na PowerShell?
Remove-Item -Path 'C:\scripts\file.txt'

Olee otú gosipụta 10 ọhụrụ e nke a faịlụ na PowerShell?
Get-Content -Path 'C:\scripts\log.txt' -Tail 10

Olee otú ịkpọghee ọtụtụ faịlụ nke a nchekwa na PowerShell?
Get-ChildItem -Path 'C:\scripts\Modules' | Unblock-File

Esi wepụ efu e si a faịlụ na PowerShell?
(Get-Content -Path file.txt) | Where-Object -FilterScript {$_.Trim() -ne '' } | Set-Content -Path file.txt

Olee otú lelee ma ọ bụrụ na otu faịlụ dị na PowerShell?

Esi na Kacha ọhụrụ / kasị ochie kere faịlụ na a nchekwa na PowerShell?

Esi wepụ oyiri e si a faịlụ na PowerShell?

Esi faịlụ kere ọzọ ma ọ bụ ihe na-erughị 1 ọnwa na a nchekwa na PowerShell?

Esi faịlụ kere ọzọ ma ọ bụ ihe na-erughị 1 afọ na a nchekwa na PowerShell?

Olee otú mbupu uru nke a agbanwe ka a faịlụ na PowerShell?
Set-Content -Path file.txt -Value $variable

Olee otú ịgụ ọnụ ọgụgụ nke faịlụ (* .txt) na a nchekwa na PowerShell?

Olee otú ịchọ a eriri n’ime otutu faịlụ na PowerShell?
Select-String -Path 'C:\*.txt' -Pattern 'Steve'

Olee otú na-egosipụta mbụ / n’ahịrị ikpeazụ nke a faịlụ na PowerShell?

Olee otú na-egosipụta a kpọmkwem akara ọnụ ọgụgụ nke a faịlụ na PowerShell?

Olee otú ịgụ ọnụ ọgụgụ nke e nke a faịlụ na PowerShell?

Olee otú ịgụ ọnụ ọgụgụ nke odide na okwu nke a faịlụ na PowerShell?

Olee otú ibudata a faịlụ na PowerShell?
Invoke-WebRequest -Uri 'http://www.nirsoft.net/utils/searchmyfiles.zip' -OutFile 'C:\tools\searchmyfiles.zip'

Olee otú gosipụta zuru ụzọ nke a faịlụ na PowerShell?
Resolve-Path -Path .\script.ps1 # Return C:\Scripts\script.ps1

Copy

Olee otú idetuo otu faịlụ ka a nchekwa na PowerShell?
Copy-Item -Path 'C:\source\file.txt' -Destination 'C:\destination'

Olee otú idetuo otu faịlụ ka otutu nchekwa na PowerShell?

Olee otú idetuo otutu faịlụ ka otu nchekwa na 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

Esi achọta Global katalọgụ sava na-arụsi ọrụ Ndekọ na PowerShell?
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().GlobalCatalogs

Esi achọta saịtị na ọrụ Ndekọ na PowerShell?
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites

Esi achọta ugbu a na ngalaba njikwa na PowerShell?
(Get-ADDomainController).HostName

Esi achọta niile ngalaba njikwa na a na ngalaba na PowerShell?

Olee otú ịchọta AD mmeputakwa ọdịda na PowerShell?
Get-ADReplicationFailure dc02.domain.com # Windows 8 and 2012

Olee otú ịchọta okuteili ndụ maka oké ọhịa na-arụ ọrụ Ndekọ na PowerShell?

Esi nkọwa nke ọhịa / ngalaba na-arụsi ọrụ Ndekọ na PowerShell?

Esi n’okporo ụzọ ndị “ehichapụ ihe” akpa na-arụsi ọrụ Ndekọ na PowerShell?
(Get-ADDomain).DeletedObjectsContainer

Olee otú aka AD egweri biini atụmatụ Ọrụ Ndekọ na PowerShell?

Olee otú iji weghachi ihe AD Akaụntụ si egweri biini na-arụsi ọrụ Ndekọ na PowerShell?
Get-ADObject -Filter 'samaccountname -eq "powershellguru"' -IncludeDeletedObjects | Restore-ADObject

Olee otú ịchọta FSMO ọrụ na PowerShell?

Olee otú jikọọ a kpọmkwem ngalaba njikwa na PowerShell?
Get-ADUser -Identity $user -Server 'serverDC01'

Esi na nke ugbu a jikọọ nkesa na PowerShell?

Olee otú ime “gpupdate” na kọmputa PowerShell?
Invoke-GPUpdate -Computer $computer -Force -RandomDelayInMinutes 0 # Windows 2012

Groups

Olee otú ike ọhụrụ ìgwè na Ọrụ Ndekọ na PowerShell?

Esi wepụ otu ìgwè na Ọrụ Ndekọ na PowerShell?
Remove-ADGroup -Identity 'PowershellGuru'

Olee otú ịgbakwunye a onye ọrụ na otu ìgwè na Ọrụ Ndekọ na PowerShell?
Add-ADGroupMember "Powershell Guru" -Members powershellguru

Esi wepụ a onye ọrụ si otu ìgwè na Ọrụ Ndekọ na PowerShell?
Remove-ADGroupMember 'Powershell Guru' -Members powershellguru

Esi achọta efu iche iche (na-enweghị òtù) na Ọrụ Ndekọ na PowerShell?
Get-ADGroup -Filter * -Properties Members | Where-Object -FilterScript {-not $_.Members}

Olee otú ịgụ efu iche iche (na-enweghị òtù) na Ọrụ Ndekọ na PowerShell?
(Get-ADGroup -Filter * -Properties Members | Where-Object -FilterScript {-not $_.Members}).Count

Esi na òtù nke otu ìgwè na-arụsi ọrụ Ndekọ na PowerShell?

Esi na òtù nke otu ìgwè na imekwa so na-arụ Ndekọ na PowerShell?

Olee otú ịgụ ọnụ ọgụgụ nke òtù nke otu ìgwè na / enweghị imekwa so na-arụ Ndekọ na PowerShell?

Users

Olee otú iji a wildcard na nyo nke “Bilie-ADOnye ọrụ” na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú ịkwaga a onye ọrụ ọzọ ma ọ na-arụsi ọrụ Ndekọ na PowerShell?
Move-ADObject -Identity $dn -TargetPath 'OU=myOU,DC=domain,DC=com'

Esi achọta niile so na-(kpara akwụ) n’ihi na onye ọrụ na PowerShell?
Get-ADGroup -LDAPFilter "(member:1.2.840.113556.1.4.1941:=$($dn))"

Esi ndị òtù (obere aha / medata) n’ihi na onye ọrụ na PowerShell?
(Get-ADUser $user -Properties MemberOf).MemberOf | ForEach-Object -Process {($_ -split ',')[0].Substring(3)} | Sort-Object

Olee otú nyegharịa Aha (Aha N’uju), (Aha Igozi), Aha Enyere (Aha Mbụ), na Aha nna (Aha Ikpeazụ) n’ihi na a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú ịgbanwe Ikowa, Ulọ ọrụ, na nọmba ekwentị maka a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?
Set-ADUser $samAccountName -Description 'IT Consultant' -Office 'Building B' -OfficePhone '12345'

Olee ka ngafe ụbọchị ka “31/12/2015” ma ọ bụ “Ọ dịghị mgbe” n’ihi na a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú Ị kpọghee ekwt a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?
Unlock-ADAccount $samAccountName

Olee otú aka / gbanyụọ a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?

Esi wepụ a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?
Remove-ADUser $samAccountName

Otú iji tọgharịa paswọọdụ n’ihi na otu onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?

Otú iji tọgharịa paswọọdụ ruo ọtụtụ ọrụ akaụntụ (nnukwu) na Ọrụ Ndekọ na PowerShell?

Olee otú ya ịchọta onye nwe nke a faịlụ na Ọrụ Ndekọ na PowerShell?

Olee otú ịchọta ma ọ (nzukọ ofu) n’ihi na onye ọrụ na-arụsi ọrụ Ndekọ na PowerShell?
[regex]::match("$((Get-ADUser $user -Properties DistinguishedName).DistinguishedName)",'(?=OU=)(.*\n?)').value

Esi achọta ndị nwere nkwarụ ọrụ akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?

Esi achọta kubie ume ọrụ akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?
Search-ADAccount -AccountExpired

Esi achọta Kpọchiri Akpọchi ọrụ akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?
Search-ADAccount -LockedOut

Olee otú ịchọta SID nke a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?
(Get-ADUser $user -Properties SID).SID.Value

Olee otú iji tọghata a na aha njirimara na-SID na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú iji tọghata a SID ka aha njirimara na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú gbawaa na-akwanyere ùgwù Aha nke a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú ịchọta ụbọchị nke ihe e kere eke / mgbanwe nke a onye ọrụ na akaụntụ na-arụsi ọrụ Ndekọ na PowerShell?
Get-ADUser -Identity $user -Properties whenChanged, whenCreated | Format-List -Property whenChanged, whenCreated

Olee otú gosipụta nhọrọ na amanyere bụ iwu Njirimara maka klas “Onye ọrụ” na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú esi na LDAP ụzọ a onye ọrụ na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú ịgbanwe cn (mejupụtara Aha) maka a onye ọrụ na-arụsi ọrụ Ndekọ na PowerShell?
Rename-ADObject $((Get-ADUser $user -Properties DistinguishedName).DistinguishedName) -NewName 'Steve Renard'

Olee otú esi nzukọ Ofu (OU) nne na nna nke onye ọrụ na-arụsi ọrụ Ndekọ na PowerShell?

Esi na onye nwe a onye ọrụ (onye kere akaụntụ) na Ọrụ Ndekọ na PowerShell?

Olee otú iji tọghata PwdLastSet àgwà n’ihi na onye ọrụ na-arụsi ọrụ Ndekọ na PowerShell?

Computers

Olee otú nwalee ala ọwa n’etiti obodo na kọmputa na ngalaba na PowerShell?
Test-ComputerSecureChannel

Olee otú ịrụzi ala ọwa n’etiti obodo na kọmputa na ngalaba na PowerShell?
Test-ComputerSecureChannel -Repair

Olee otú iji gbanyụọ kọmputa akaụntụ Ọrụ Ndekọ na PowerShell?
Disable-ADAccount $computer

Esi achọta kọmputa na kpọmkwem Sistem na-arụ ọrụ na-arụsi ọrụ Ndekọ na PowerShell?

Organizational Unit (OU)

Otú ike otu nzukọ unit (OU) na Ọrụ Ndekọ na PowerShell?
New-ADOrganizationalUnit -Name 'STEVE' -Path 'DC=domain,DC=com'

Esi nzukọ Ofu (OU) nkọwa na Ọrụ Ndekọ na PowerShell?
Get-ADOrganizationalUnit 'OU=STEVE,DC=domain,DC=com' -Properties *

Olee otú ịgbanwe nkọwa nke otu nzukọ Ofu (OU) na Ọrụ Ndekọ na PowerShell?
Set-ADOrganizationalUnit 'OU=STEVE,DC=domain,DC=com' -Description 'My description'

Olee otú aka / gbanyụọ otu nzukọ unit (OU) si mberede nhichapụ na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú aka mberede nhichapụ nile nzukọ unit (OU) na Ọrụ Ndekọ na PowerShell?

Olee otú ihichapụ otu nzukọ Ofu (OU) na-echebe site mberede nhichapụ na-arụsi ọrụ Ndekọ na PowerShell?

Olee otú iji tọghata a na-akwanyere ùgwù Aha nke otu nzukọ unit (OU) na-mejupụtara Aha Ọrụ Ndekọ na PowerShell?

Olee otú depụta efu nzukọ Units (OUs) na PowerShell?

Esi njikwa nke otu ìgwè na PowerShell?
(Get-ADGroup $dn -Properties Managedby).Managedby

Up


Regex (Regular Expression)

Olee otú wepụ ihe na adreesị IP V4 (80.80.228.8) na Regex na 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

Olee otú wepụ a Mac adreesị (C0-D9-62-39-61-2D) na iweputa “-” na Regex na 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

Olee otú wepụ a Mac adreesị (C0: D9: 62: 39: 61: 2D) na iweputa “:” na Regex na 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

Olee otú wepụ a ụbọchị (10/02/2015) na Regex na PowerShell?
$example = 'The date is 10/02/2015'
$date = [regex]::match($example,'(\d{2}\/\d{2}\/\d{4})').value

Olee otú wepụ a URL (www.powershell-guru.com) na Regex na PowerShell?
$example = 'The URL is www.powershell-guru.com'
$url = [regex]::match($example,'[a-z]+[:.].*?(?=\s)').value

Olee otú wepụ ihe email (user@domain.com) na Regex na 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

Olee otú wepụ “ozizi” site eriri atụ na Regex na PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=-)(.*\n?)(?=.com)').value

Olee otú wepụ “guru.com” site eriri atụ na Regex na PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=-)(.*\n?)(?<=.)').value

Olee otú wepụ “powershell-guru.com” site eriri atụ na Regex na PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=www.)(.*\n?)').value

Olee otú wepụ “123” site eriri atụ na Regex na PowerShell?
$example = 'Powershell123'
[regex]::match($example,'(\d+)').value

Olee otú wepụ “$” (dollar ịrịba ama) si eriri atụ na Regex na PowerShell?
$example = 'Powershell`$123'
[regex]::match($example,'(\$)').value

Olee otú dochie a agwa (* .com) na ọzọ (* .fr) na a eriri na Regex na PowerShell?
$example = 'www.powershell-guru.com'
[regex]::Replace($example, '.com','.fr')

Olee otú gbapụ a eriri na Regex na PowerShell?
[regex]::Escape('\\server\share')

Up


Memory

Olee otú ịmanye a akpọkọta nke na ebe nchekwa site na mkpofu mkpoko na PowerShell?
[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()

Esi ebule saiz nke a na kọmputa na PowerShell?

Up


Date

Esi na nke ugbu a ụbọchị na PowerShell?
Get-Date
[Datetime]::Now

Olee otú gosipụta oge dị iche iche usoro na PowerShell?

Olee otú iji tọghata a ụbọchị (Ubọchịoge) ka a ụbọchị (eriri) na PowerShell?
$datetimeToString = '{0:dd/MM/yy}' -f (Get-Date 30/01/2015)
$datetimeToString = (Get-Date 31/01/2015).ToShortDateString()

Olee otú iji tọghata a ụbọchị (eriri) ka a ụbọchị (Ubọchịoge) na PowerShell?
$stringToDatetime = [Datetime]::ParseExact('30/01/2015', 'dd/MM/yyyy', $null)

Olee otú gbakọọ dị iche (nọmba nke Ubọchị, awa, minit, ma ọ bụ Sekọnd) n’etiti ụbọchị abụọ na 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

Olee otú iji ụbọchị abụọ na PowerShell?
(Get-Date 2015-01-01) -lt (Get-Date 2015-01-30) # True
(Get-Date 2015-01-01) -gt (Get-Date 2015-01-30) # False

Olee otú aka idozi ihe n’usoro nke ụbọchị dị ka “Ubọchịoge” na PowerShell?
$arrayDate | Sort-Object -Property {$_ -as [Datetime]}

Olee ka na-amalite na-akwụsị a elekere nkwụsị na PowerShell?
$chrono = [Diagnostics.Stopwatch]::StartNew()
$chrono.Stop()
$chrono

Esi na nke ugbu a n’ụbọchị izu na PowerShell?
(Get-Date).DayOfWeek #Sunday

Esi ụnyaahụ si ụbọchị na PowerShell?
(Get-Date).AddDays(-1)

Esi ọnụ ọgụgụ nke ụbọchị a ọnwa (na Februari 2015) na PowerShell?
[DateTime]::DaysInMonth(2015, 2)

Olee otú ịmara a itu ukwu afọ na PowerShell?
[DateTime]::IsLeapYear(2015)

Olee otú depụta oge zones na PowerShell?
[System.TimeZoneInfo]::GetSystemTimeZones()

Up


Networking

Olee otú encode (na usoro ASCII ) na itapia a URL na PowerShell?

Gịnị bụ udinha nke ala netwọk iwu na PowerShell?

Esi adreesị IP na PowerShell?
Get-NetIPAddress # Windows 8.1 & Windows 2012
Get-NetIPConfiguration # Windows 8.1 & Windows 2012

Olee otú iji gbanyụọ adreesị IP V6 (IPv6) na PowerShell?

Olee otú emere ebere ihe na adreesị IP V4 (IPv4) na PowerShell?
if([ipaddress]'10.0.0.1'){'validated'}

Esi achọta mpụga adreesị IP na PowerShell?

Olee otú ịchọta Hostname site na adreesị IP na PowerShell?
([System.Net.Dns]::GetHostEntry($IP)).Hostname

Olee otú ịchọta adreesị IP a Usuaha na PowerShell?
([System.Net.Dns]::GetHostAddresses($computer)).IPAddressToString

Olee otú ịchọta FQDN si a Usuaha na PowerShell?
[System.Net.Dns]::GetHostByName($computer).HostName

Esi achọta netwọk nhazi (IP, Subnet, ọnụ ụzọ ámá, na DNS) na PowerShell?

Olee otú ịchọta Mac adreesị PowerShell?
Get-CimInstance win32_networkadapterconfiguration | Select-Object -Property Description, Macaddress
Get-WmiObject -Class win32_networkadapterconfiguration | Select-Object -Property Description, Macaddress

Olee otú uda a na kọmputa na PowerShell?

Olee otú lelee ma ọ bụrụ na kọmputa na jikọọ na internet na PowerShell?

Olee otú ịrụ a “whois” Nchọgharị maka a website na PowerShell?
$whois = New-WebServiceProxy 'http://www.webservicex.net/whois.asmx?WSDL'
$whois.GetWhoIs('powershell-guru.com')

Esi nkọwa nke a n’ihu ọha IP (Geolocation) na PowerShell?

Olee otú lelee ma ọ bụrụ a mmiri n’ọdụ ụgbọ mmiri bụ na-emeghe / emechi na PowerShell?
New-Object -TypeName Net.Sockets.TcpClient -ArgumentList $computer, 135

Olee otú ime “tracert” na PowerShell?
Test-NetConnection www.google.com -TraceRoute

Olee otú idozi a n’ụlọ netwọk njikọ profaịlụ PowerShell?
Get-NetAdapter | Format-Table -Property Name, InterfaceDescription, ifIndex -AutoSize # Windows 8.1
Set-NetConnectionProfile -InterfaceIndex 6 -NetworkCategory Private

Olee otú na-egosi TCP mmiri n’ọdụ ụgbọ mmiri njikọ PowerShell?
netstat.exe -ano
Get-NetTCPConnection #Windows 8 and 2012

Olee ka ebelata a ogologo URL n’ime a obere URL na PowerShell?
$url = 'www.powershell-guru.com'
$tiny = Invoke-RestMethod -Uri "http://tinyurl.com/api-create.php?url=$url"

Esi proxy ntọala na PowerShell?
Get-ItemProperty -Path HKCU:"Software\Microsoft\Windows\CurrentVersion\Internet Settings"

DNS

Olee otú ịlele DNS cache na mpaghara na kọmputa na PowerShell?
ipconfig.exe /displaydns
Get-DnsClientCache #Windows 8 and 2012

Olee otú ikpochapụ a DNS cache na mpaghara na kọmputa na PowerShell?
ipconfig.exe /flushdns
Start-Process -FilePath ipconfig -ArgumentList /flushdns -WindowStyle Hidden
Clear-DnsClientCache #Windows 8 and 2012

Olee otú ikpochapụ a DNS cache na n’ime obodo kọmputa na PowerShell?
Invoke-Command -ScriptBlock {Clear-DnsClientCache} -ComputerName computer01, computer02

Olee otú ịgụ ụsụụ ndị agha faịlụ na PowerShell?
Get-Content -Path 'C:\Windows\system32\drivers\etc\hosts'

Up


Password

Olee otú n’ịwa a nkịtị paswọọdụ na PowerShell?
[Reflection.Assembly]::LoadWithPartialName('System.Web')
[System.Web.Security.Membership]::GeneratePassword(30,2)

Olee otú ịgbanwe obodo paswọọdụ maka onye nchịkwa a ime ihe nkesa na PowerShell?
$admin = [ADSI]('WinNT://server01/administrator,user')
$admin.SetPassword($password)
$admin.SetInfo()

Esi achọta paswọọdụ ngafe ụbọchị nke otu akaụntụ Ọrụ Ndekọ na PowerShell?

Up


Printers

Olee otú depụta niile na-ebi akwụkwọ nke a kpọmkwem nkesa na PowerShell?
Get-WmiObject -Query 'Select * From Win32_Printer' -ComputerName $computer

Olee otú depụta niile ọdụ ụgbọ mmiri nke a kpọmkwem nkesa na PowerShell?
Get-WmiObject -Class Win32_TCPIPPrinterPort -Namespace 'root\CIMV2' -ComputerName $computer

Olee otú ịgbanwe ikwu / ọnọdụ nke a na ngwa nbipute na PowerShell?

Olee otú kpochapu (ịkagbu niile ọrụ) a na ngwa nbipute na PowerShell?
$printer = Get-WmiObject -Class win32_printer -Filter "Name='HP Deskjet 2540 series'"
$printer.CancelAllJobs()

Olee otú ibipụta a ule na peeji nke a na ngwa nbipute na PowerShell?
$printer = Get-WmiObject -Class win32_printer -Filter "Name='HP Deskjet 2540 series'"
$printer.PrintTestPage()

Esi na-ebipụta queues n’ihi na-ebi akwụkwọ na PowerShell?

Up


Regedit

Read

Olee otú depụta ndekọ ekwo na PowerShell?
Get-ChildItem -Path Registry::

Esi ndekọ ụkpụrụ na uru ụdị na PowerShell?

Olee otú depụta ndekọ isi subkeys na PowerShell?

Olee otú depụta ndekọ isi obere isi na a imekwa ụzọ na PowerShell?
Get-ChildItem -Path 'HKLM:\SYSTEM' -Recurse -ErrorAction SilentlyContinue

Esi achọta obere isi na kpọmkwem aha na PowerShell?
Get-ChildItem -Path 'HKLM:\SOFTWARE' -Include *Plugin* -Recurse -ErrorAction SilentlyContinue

Olee otú laghachi naanị aha ndekọ obere isi na PowerShell?
(Get-ChildItem -Path 'HKLM:\SYSTEM').Name # Return HKEY_LOCAL_MACHINE\SYSTEM\ControlSet
Get-ChildItem -Path 'HKLM:\SYSTEM' -Name # Return ControlSet

Olee otú depụta ndekọ ụkpụrụ na PowerShell?
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'

Olee otú ịgụ a kpọmkwem ndekọ uru na PowerShell?
(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ProductName

Olee otú ịgụ a kpọmkwem ndekọ uru na a na n’ime ime obodo na kọmputa na PowerShell?

Write

Olee otú ike ọhụrụ ndekọ isi na PowerShell?
New-Item -Path 'HKCU:\Software\MyApplication'

Otú ike a ndekọ uru na PowerShell?
New-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version' -Value '1.0'

Olee otú gbanwee dịbunụ ndekọ uru na PowerShell?
Set-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version' -Value '2.0'

Delete

Olee otú ihichapụ a ndekọ uru na PowerShell?
Remove-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version'

Olee otú ihichapụ a ndekọ isi na PowerShell?
Remove-Item -Path 'HKCU:\Software\MyApplication' -Force

Test

Olee otú nwalee ma ọ bụrụ na a ndekọ isi dị na PowerShell?
Test-Path -Path 'HKCU:\Software\MyApplication'

Olee otú nwalee ma ọ bụrụ na a ndekọ uru dị na PowerShell?
(Get-Item -Path 'HKCU:\Software\MyApplication').GetValueNames() -contains 'Version'

Up


Strings

Esi wepụ ọcha-ohere odide site na mmalite nke a eriri na PowerShell?
$string = ' PowershellGuru'
$string = $string.TrimStart()

Esi wepụ ọcha-ohere odide si ọgwụgwụ nke a eriri na PowerShell?
$string = 'PowershellGuru '
$string = $string.TrimEnd()

Esi wepụ ọcha-ohere odide (amalite na-agwụcha) nke a eriri na PowerShell?
$string = ' PowershellGuru '
$string = $string.Trim()

Olee otú iji tọghata a eriri na-elu bụrụ na PowerShell?
$string = 'powershellguru'
$string = $string.ToUpper()

Olee otú iji tọghata a eriri ibuda ala bụrụ na PowerShell?
$string = 'POWERSHELLGURU'
$string = $string.ToLower()

Olee otú iji họrọ obere-eriri “PowerShell” nke eriri “PowerShellOkachamara” na PowerShell?
$string.Substring(0,10)

Olee otú iji họrọ obere-eriri “ozizi” nke eriri “PowerShellOkachamara” na PowerShell?
$string.Substring(10)

Olee ka họrọ nọmba “123” nke “PowerShell123Okachamara” na PowerShell?
$string = 'Powershell123Guru'
[regex]::match($string,'(\d+)').value

Esi efu dabeere ndeksi nke “ozizi” nke eriri “PowerShellOkachamara” na PowerShell?
$string.IndexOf('Guru') # 10

Olee otú lelee ma ọ bụrụ a eriri bụ null ma ọ bụ ihe efu na PowerShell?
$string = $null
$string = ''
[string]::IsNullOrEmpty($string)

Olee otú lelee ma ọ bụrụ a eriri bụ null, efu, ma ọ bụ ndị mejupụtara nanị nke na-acha ọcha-ohere odide na PowerShell?
$string = $null
$string = ''
$string = ' '
[string]::IsNullOrWhiteSpace($string)

Olee otú lelee ma ọ bụrụ a eriri e dere a kpọmkwem akwụkwọ ozi na PowerShell?
$string = 'PowershellGuru'
$string.Contains('s')
[regex]::match($string,'s').Success

Olee otú laghachi ogologo nke a eriri na PowerShell?
$string.Length

Olee otú concatenate abụọ urụk na PowerShell?

Olee otú iji kwekọọ n’ihi na otu onye ma ọ bụ ọtụtụ mgbodo “[]” na a eriri na PowerShell?
$string = '[PowershellGuru]'
$string -match '\[' # Only 1
$string -match '\[(.*)\]' # Several

Olee otú iji kwekọọ n’ihi na otu onye ma ọ bụ ọtụtụ mgbodo “()” na a eriri na PowerShell?
$string = '(PowershellGuru)'
$string -match '\(' # Only 1
$string -match '\((.*)\)' # Several

Olee otú iji kwekọọ n’ihi na otu onye ma ọ bụ ọtụtụ mgbakọ mgbodo “{}” na a eriri na PowerShell?
$string = '{PowershellGuru}'
$string -match '\{' # Only 1
$string -match '\{(.*)\}' # Several

Olee otú iji kwekọọ n’ihi na otu onye ma ọ bụ ọtụtụ n’akuku mgbodo “<>” na a eriri na PowerShell?
$string = ''
$string -match '\<' # Only 1
$string -match "\<(.*)\>" # Several

Olee otú iji kwekọọ ọ bụla ibuda ala akwụkwọ ozi (ABC) na a eriri na PowerShell?
$string = 'POWERSHELLGURU'
$string -cmatch "^[a-z]*$" #False

Olee otú iji kwekọọ ọ bụla elu elu akwụkwọ ozi (ABC) na a eriri na PowerShell?
$string = 'powershellguru'
$string -cmatch "^[A-Z]*$" #False

Olee otú iji kwekọọ “[p” (p ala ikpe) na a eriri na PowerShell?
$string = '[powershellGuru]'
$string -cmatch '\[[a-z]\w+' #True

Olee otú iji kwekọọ “[P” (P elu ikpe) na a eriri na PowerShell?
$string = '[PowershellGuru]'
$string -cmatch '\[[A-Z]\w+' #True

Olee otú dochie a na akara na ọzọ na akara na PowerShell?
$a = 'Line A'
$b = 'Line B'
$a = $a -replace $a, $b

Olee otú iji tọghata a nkewa ime ka a eriri (pasent) na PowerShell?
(1/2).ToString('P')

Olee otú idozi urụk nwere nọmba na PowerShell?

Olee otú iji họrọ ikpeazụ okwu nke a ikpe na PowerShell?
$sentence = 'My name is Steve Renard'
$sentence.Split(' ')[-1] # Returns Renard

Esi ndị kasị ibu okwu a ikpe na PowerShell?
$sentence = 'My name is Steve Renard'
$sentence.Split(' ') | Sort-Object -Property Length | Select-Object -Last 1 # Returns Renard

Olee otú ịgụ ọnụ ọgụgụ nke ugboro a eriri bụ ugbu n’ime a ikpe na PowerShell?
$sentence = 'steve steve steve renard'
[regex]::Matches($sentence, 'steve').Count # Returns 3

Olee otú idetuo ọ bụla agwa na a eriri ka a agwa n’usoro na PowerShell?

Olee otú iji tọghata akpa leta elu elu ikpe nke a eriri na PowerShell?

Olee ka na mpe mpe akwa (ekpe ma ọ bụ aka nri) a eriri na PowerShell?

Olee otú encode na itapia a eriri ka Base64 na PowerShell?

Olee otú iji tọghata a ọnụ ọgụgụ (ka na site) ọnụọgụ abụọ na PowerShell?

Olee otú laghachi naanị ikpeazụ nne na nna nchekwa na a ụzọ na PowerShell?

Olee otú laghachi naanị ikpeazụ ihe na a ụzọ na PowerShell?

Up


Math

Olee otú depụta usoro ndị na-Sistem.Math na klas na PowerShell?
[System.Math] | Get-Member -Static -MemberType Method

Olee otú laghachi zuru uru na PowerShell?
[Math]::Abs(-12) #Returns 12
[Math]::Abs(-12.5) # Returns 12.5

Olee otú laghachi n’akuku onye-enweghị bụ kpọmkwem ọnụ ọgụgụ na PowerShell?
[Math]::ASin(1) #Returns 1,5707963267949

Olee otú laghachi n’uko uru na PowerShell?
[Math]::Ceiling(1.4) #Returns 2
[Math]::Ceiling(1.9) #Returns 2

Olee otú laghachi n’ala uru na PowerShell?
[Math]::Floor(1.4) #Returns 1
[Math]::Floor(1.9) #Returns 1

Olee otú laghachi eke (isi e) logarithm nke a kpọmkwem ọnụ ọgụgụ na PowerShell?
[Math]::Log(4) #Returns 1,38629436111989

Olee otú laghachi ukot 10 logarithm nke a kpọmkwem ọnụ ọgụgụ na PowerShell?
[Math]::Log10(4) #Returns 0,602059991327962

Olee otú laghachi kacha nke abụọ ụkpụrụ na PowerShell?
[Math]::Max(2,4) #Returns 4
[Math]::Max(-2,-4) #Returns -2

Olee otú laghachi na nke kacha nta nke abụọ ụkpụrụ na PowerShell?
[Math]::Min(2,4) #Returns 2
[Math]::Max(-2,-4) #Returns -4

Olee otú laghachi a ọnụ ọgụgụ zụlitere ka a kpọmkwem ike na PowerShell?
[Math]::Pow(2,4) #Returns 16

Olee otú laghachi a ntụpọ uru ka kacha nso integral uru na PowerShell?
[Math]::Round(3.111,2) #Returns 3,11
[Math]::Round(3.999,2) #Returns 4

Olee otú laghachi na akụkụ nke a kpọmkwem ntụpọ ọnụ ọgụgụ na PowerShell?
[Math]::Truncate(3.111) #Returns 3
[Math]::Truncate(3.999) #Returns 3

Olee otú laghachi na skware mgbọrọgwụ nke a kpọmkwem ọnụ ọgụgụ na PowerShell?
[Math]::Sqrt(16) #Returns 4

Olee otú laghachi na PI mgbe nile na PowerShell?
[Math]::Pi #Returns 3,14159265358979

Olee otú laghachi eke logarithmic isi (mgbe nile e) na PowerShell?
[Math]::E #Returns 2,71828182845905

Olee otú lelee ma ọ bụrụ na ọtụtụ bụ ọbụna ma ọ bụ iberibe na PowerShell?
[bool]($number%2)

Up


Hashtables

Otú ike ihe efu gwakota-okpokoro na PowerShell?
$hashtable = @{}
$hashtable = New-Object -TypeName System.Collections.Hashtable

Otú ike a gwakota-okpokoro na ihe na PowerShell?

Otú ike a gwakotao-kpokoro ota site isi / aha (nyere iwu ọkọwa okwu) na ihe na PowerShell?

Olee ka ịgbakwunye ihe na (isi-uru ụzọ) ka a gwakota okpokoro na PowerShell?
$hashtable.Add('Key3', 'Value3')

Esi a kpọmkwem uru nke a gwakota-okpokoro na PowerShell?
$hashtable.Key1
$hashtable.Get_Item('Key1')

Esi opekempe uru nke a gwakota-okpokoro na PowerShell?

Esi na kacha uru nke a gwakotao-kpokoro na PowerShell?

Olee otú gbanwee ihe na a gwakota-okpokoro na PowerShell?
$hashtable.Set_Item('Key1', 'Value1Updated')

Esi wepụ ihe na a gwakota-okpokoro na PowerShell?
$hashtable.Remove('Key1')

Olee otú ikpochapụ a gwakota-okpokoro na PowerShell?
$hashtable.Clear()

Olee otú elele ọnụnọ nke a kpọmkwem isi / uru a gwakota-okpokoro na PowerShell?
$hashtable.ContainsKey('Key3')
$hashtable.ContainsValue('Value3')

Olee otú idozi site isi / uru a gwakota-okpokoro na PowerShell?
$hashtable.GetEnumerator() | Sort-Object -Property Name
$hashtable.GetEnumerator() | Sort-Object -Property Value -Descending

Up


Arrays

Otú ike ihe efu n’usoro na PowerShell?
$array = @()
$array = [System.Collections.ArrayList]@()

Otú ike otu n’usoro na ihe na PowerShell?
$array = @('A', 'B', 'C')
$array = 'A', 'B', 'C'
$array = 'a,b,c'.Split(',')
$array = .{$args} a b c
$array = echo a b c

Olee ka ịgbakwunye ihe na otu n’usoro na PowerShell?
$array += 'D'
[void]$array.Add('D')

Olee otú gbanwee ihe na-n’usoro na PowerShell?
$array[0] = 'Z' # 1st item[0]

Olee otú ịlele size nke otu n’usoro na PowerShell?
$array = 'A', 'B', 'C'
$array.Length # Returns 3

Olee otú iji weghachite otu ihe / ọtụtụ / ihe niile dị otu n’usoro na PowerShell?
$array = @('A', 'B', 'C')
$array[0] # One item (A)
$array[0] + $array[2] # Several items (A,C)
$array # All items (A,B,C)

Esi wepụ efu ihe na otu n’usoro na PowerShell?
$array = @('A', 'B', 'C', '')
$array = $array.Split('',[System.StringSplitOptions]::RemoveEmptyEntries) | Sort-Object # A,B,C

Olee otú lelee ma ọ bụrụ na otu ihe dị otu n’usoro na PowerShell?
$array = @('A', 'B', 'C')
'A' | ForEach-Object -Process {$array.Contains($_)} # Returns True
'D' | ForEach-Object -Process {$array.Contains($_)} # Returns False

Esi achọta ndeksi ọnụ ọgụgụ nke otu ihe n’ime otu n’usoro na PowerShell?
$array = @('A', 'B', 'C')
[array]::IndexOf($array,'A') # Returns 0

Olee otú iji dozie ka nke ihe na-n’usoro na PowerShell?
$array = @('A', 'B', 'C')
[array]::Reverse($array) # C,B,A

Olee otú n’ịwa a random ihe site otu n’usoro na PowerShell?
$array | Get-Random

Olee otú idozi otu n’usoro na-arịgo / agbadata ụzọ na PowerShell?
$array = @('A', 'B', 'C')
$array | Sort-Object # A,B,C
$array | Sort-Object -Descending # C,B,A

Olee otú ịgụ ọnụ ọgụgụ nke ihe na-n’usoro na PowerShell?
$array.Count

Olee otú ịgbakwunye otu n’usoro ọzọ na PowerShell?
$array1 = 'A', 'B', 'C'
$array2 = 'D', 'E', 'F'
$array3 = $array1 + $array2 # A,B,C,D,E,F

Esi achọta duplicates site na n’usoro na PowerShell?
$array = 'A', 'B', 'C', 'C'
($array | Group-Object | Where-Object -FilterScript {$_.Count -gt 1}).Values # Returns C

Esi wepụ oyiri site na n’usoro na PowerShell?
$array = 'A', 'B', 'C', 'C'
$array = $array | Select-Object -Unique
$array # Returns A,B,C

Otú ike otu n’usoro na ihe malite na a nganiihu (“user01”, “user02”, … “user10”) na PowerShell?
$array = 1..10 | ForEach-Object -Process { "user$_" }

Up


ACL

Olee otú depụta ACL nke AD ọrụ na PowerShell?
(Get-Acl -Path "AD:\$dn").Access

Olee otú depụta ACL nke a nchekwa na PowerShell?
(Get-Acl -Path C:\scripts).Access

Olee otú depụta kpọmkwem ACL ikike Ndenye (ọrụ ma ọ bụ ìgwè dị iche iche) nke a AD ọrụ na PowerShell?

Up


Variables

Gịnị bụ ihe ndị kasị data ụdị na PowerShell?

Olee otú ịchọta kacha nta na kacha ụkpụrụ maka ụdị ụfọdụ variables na PowerShell?

Olee otú nwalee dataụdị na PowerShell?

Otú ike a Lee-eriri agbanwe na PowerShelll?

Otú ike a agbanwe na PowerShell?
$powershellGuru = 'Hello'

Otú ike a mgbe nile agbanwe na PowerShell?
Set-Variable -Name powershellGuru -Value 2015 -Option Constant

Otú ike a zuru ụwa ọnụ agbanwe na PowerShell?
$Global:powershellGuru = 'Hello'

Olee otú ịgụ a agbanwe na PowerShell?
$powershellGuru = 'Hello' # Create
$powershellGuru # Read
Get-Variable -Name powershellGuru -ValueOnly # Read

Olee otú elele ụdị nke a agbanwe na PowerShell?
$powershellGuru.GetType()

Olee otú ịchọta agbanwe na zuru ụwa ọnụ akporo na PowerShell?
Get-Variable -Scope Global

Esi kpọmkwem agbanwe site aha na PowerShell?
Get-Variable -Include *Preference -Exclude W*

Olee otú ha na-ekenye a kpọmkwem data ụdị a agbanwe na PowerShell?
[int64]$variable = 100
[string]$variable = 'PowershellGuru'

Olee otú mmalite mbido agbanwe na otu uru na PowerShell?
$a = $b = $c = $d = $e = 0

Gịnị bụ utu aha maka agbanwe “$ _” na PowerShell?
Get-Process | Where-Object -FilterScript {$_.Handles -gt 1000} # Using $_
Get-Process | Where-Object -FilterScript {$PSItem.Handles -gt 1000} # Using $PSItem (since version 3)

Esi wepụ agbanwe na a aha malite na “gụọ” na PowerShell?
Remove-Variable -Name count*

Esi gburugburu obodo agbanwe na PowerShell?
Get-ChildItem -Path Env:

Esi n’Ụzọ Gburugburu agbanwe akara site na akara na PowerShell?
($env:Path) -replace(';', "`n")
[Environment]::GetEnvironmentVariable('Path') -replace(';', "`n")

Olee otú ịgbakwunye ọhụrụ ụzọ (Ọpụ. C: \ SysinternalsSuite) na-n’Ụzọ Gburugburu agbanwe na PowerShell?
$env:Path += ';C:\SysinternalsSuite'
$env:Path = $env:Path + ';C:\SysinternalsSuite'

Olee otú concatenate agbanwe na PowerShell?
$a = 'Powershell'
$b = '- Guru'
$c = $a + $b

Olee otú iji NjehieAgbanwe na PowerShell?
Get-ChildItem -Path 'C:\PerfLogs' -ErrorAction SilentlyContinue -ErrorVariable AccessDenied
$AccessDenied | ForEach-Object -Process {$_.Exception}
$AccessDenied | ForEach-Object -Process {$_.TargetObject}

Olee otú aka / gbanyụọ Ẹkot “nhọrọ Akowara” (VBScript: na-achọ ka a agbanwe ẹbat) na PowerShell?

Up


Static .NET Methods

Esi na-adịgide adịgide so na PowerShell?
[DateTime] | Get-Member -Static

Up


Sounds

Olee otú igwu egwu na “mkpọtụ” ụda na PowerShell?
[System.Console]::Beep()

Olee otú igwu egwu na “akara mmuke” ụda na PowerShell?
[System.Media.SystemSounds]::Asterisk.Play()

Olee otú igwu egwu na “iti mkpu bụ” ụda naPowerShell?
[System.Media.SystemSounds]::Exclamation.Play()

Esi dị ụda na PowerShell?
[System.Media.SystemSounds] | Get-Member -Static

Olee otú igwu egwu “WAV” ụda na PowerShell?
$soundPlayer = New-Object -TypeName System.Media.SoundPlayer -ArgumentList "$env:windir\Media\Ringout.wav"
$soundPlayer.Play()
ma ọ bụ
$soundPlayer.PlayLooping()
$soundPlayer.Stop()

Olee otú iji rụọ ọrụ okwu e dere ede na PowerShell?
Add-Type -AssemblyName System.Speech
$speech = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$speech.Speak('Hello PowershellGuru')

Up


XML

Olee otú ịgụ ihe XML faịlụ na PowerShell?
[xml]$sitemap = Get-Content -Path .\sitemap.xml
$sitemap.urlset.url

Olee otú mbupu data dị ka ihe XML faịlụ na PowerShell?
Get-Process | Export-Clixml -Path C:\scripts\processes.xml

Olee otú mbubata data site na a CLIXML faịlụ na PowerShell?
$importProcesses = Import-Clixml -Path C:\scripts\processes.xml

Up


GUI

Otú ike a bụ isi GUI (Windo Ụdị) na PowerShell?

Up


Characters

Olee otú iji tọghata ASCII uru a agwa PowerShell?
[char]64

Olee otú iji tọghata a agwa ka ASCII uru na PowerShell?
[int][char]'@'

Olee otú n’ịwa mkpụrụ okwu Bekee na PowerShell?
[char[]](97..122)

Up


Compare

Olee otú iji abụọ arrays na PowerShell?

Olee otú iji abụọ Filiks na PowerShell?

Up


Microsoft Exchange

Olee otú iji weghachite ndepụta mobile ngwaọrụ mekọrịta na a ọrụ ‘igbe akwụkwọ ozi dị na PowerShell?
Get-ActiveSyncDeviceStatistics

Olee otú ịgbakwunye “Zuru Ohere” ikikere a igbe akwụkwọ ozi dị n’ihi na a onye ọrụ na PowerShell?
Add-MailboxPermission -Identity $dn -User 'DOMAIN\powershellguru' -AccessRights 'FullAccess'

Esi wepụ “Zuru Ohere” ikikere a igbe akwụkwọ ozi dị n’ihi na a onye ọrụ na PowerShell?
Remove-MailboxPermission -Identity $dn -User 'DOMAIN\powershellguru' -AccessRights 'FullAccess' -InheritanceType 'All'

Olee otú ịgbakwunye “Send Dị ka” ikikere a igbe akwụkwọ ozi dị n’ihi na a onye ọrụ na PowerShell?
Add-ADPermission -Identity $dn -User 'DOMAIN\powershellguru' -ExtendedRights 'Send-As'

Esi wepụ “Eziga Dị ka” ikikere a igbe akwụkwọ ozi dị n’ihi na a onye ọrụ na PowerShell?

Olee otú ịchọta igbe iwu si a igbe akwụkwọ ozi dị na PowerShell?
Get-InboxRule -Mailbox 'Powershell.Guru'

Esi na SMTP adreesị n’ihi na ọrụ ndị nwere OWA (Outlook Web Access) nyeere na PowerShell?
Get-CASMailbox -Filter{OWAEnabled -eq $true} | Select-Object -Property Name, PrimarySMTPAddress

Exchange 2007

Olee otú iji wụnye tupu mkpa maka ihe nkesa na Exchange Server 2007 Hub Izipu, igbe akwụkwọ ozi dị (MBX), na Client Access Server (CAS) na PowerShell?

Exchange 2010

Olee otú iji wụnye tupu mkpa maka ihe nkesa na Exchange Server 2010 Hub Izipu, igbe akwụkwọ ozi dị (MBX), na Client Access Server (CAS) na PowerShell?

Exchange 2013

Olee otú iji wụnye tupu mkpa maka ihe nkesa na Exchange Server 2013 igbe akwụkwọ ozi dị (MBX) na Client Access Server (CAS) na PowerShell?

Olee otú iji wụnye tupu mkpa maka ihe nkesa na Exchange Server 2013 Client Access Server (CAS) naanị na PowerShell?