SU’AALAHA POWERSHELL IN SOMALI

By | May 18, 2015

Fikradda : Su’aalaha ku saabsan Powershell inta badan la weydiiyay.

Waxaad isticmaali kartaa liiskan siyaabo kala duwan :

  • Si aad nuqul ka / amarrada Jinka galay script ah
  • Si deg deg ah arki while oo amarkiisa ka gaar ah
  • Si loo hagaajiyo aqoon farsamo aad
  • Si aad u ogaan amarrada cusub
  • Si aad u diyaariso wareysi shaqo

Updated
July 02, 2015
Author powershell-guru.com
Source somali.powershell-guru.com
Categories
75
Su’aalo
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

Sida loo ogaado aan version of PowerShell?

Sida loo ordo PowerShell in version kale oo waafaqsan u socdeen?
powershell.exe -Version 2.0

Sidee u baahan version yar PowerShell (3.0 oo ka sareeya) script ah oo la PowerShell?
#Requires -Version 3.0

Sidee ay u baahan yihiin mudnaanta maamul u script ah oo la PowerShell?

Sida loo hubiyo xuduudaha ka script ah oo la PowerShell?
help -Name .\Get-ExchangeEnvironmentReport.ps1 -Full

Sidee si ay u helaan macluumaad loogu talagalay user hadda la PowerShell?
[Security.Principal.WindowsIdentity]::GetCurrent()

Sida loo abuuro, edit, iyo Reload profile ah la PowerShell?

Sida loo sameeyo hakin ah oo 5 ilbiriqsi / daqiiqo in script ah oo la PowerShell?
Start-Sleep -Seconds 5
Start-Sleep -Seconds 300 # 5 minutes

Sida loo helo markii ugu danbeysay ee ay la boot PowerShell?
(Get-CimInstance -ClassName win32_operatingsystem).LastBootUpTime

Sidee loo helaa Sheelare nooca la PowerShell?

Sida loo qor barnaamijyada xawaaladaha la PowerShell ah?

Sida loo uninstall codsi la PowerShell?

Sida loo qaado shaashada ah desktop oo dhan ama uusan xirmin suuqa firfircoon la PowerShell?
Take-ScreenShot -Screen -File 'C:\scripts\screenshot.png' -Imagetype JPEG
Repository : Take-ScreenShot

Sidee loo helaa count fariin u MSMQ safafka la PowerShell ah?

Sida loo dhigay siyaasadda dil la PowerShell ah?

Sida loo abuuro toobiye ah la PowerShell?

Sida loo wareemo ama unpin barnaamij lagu Taskbar la PowerShell?

Sida loo furo Explorer Windows ah la PowerShell?
[Diagnostics.Process]::Start('explorer.exe')
Invoke-Item -Path C:\Windows\explorer.exe

Sidee inay taxaan wadayaasha qalab la PowerShell?
Get-WmiObject -Class Win32_PnPSignedDriver
Get-WindowsDriver -Online -All
driverquery.exe

Sida loo abuuro Pario ah la PowerShell?

Sida loo helo meesha uu buugga ku meel gaar ah ee user hadda la PowerShell?
[System.IO.Path]::GetTempPath()

Sidee inuu ku biiro ah waddada iyo jidka ilmo galay mid ka mid ah jidka kaliya la PowerShell?
Join-Path -Path C:\ -ChildPath \windows

Sidee inay taxaan oo dhan cmdlets “bensiin *” la PowerShell?
Get-Command -Verb Get

Sidee inaad Liiska ku fayl nidaam gaar ah la PowerShell?

Sidee Buur ISO files / VHD la PowerShell?
Mount-DiskImage 'D:\ISO\file.iso' # ISO
Mount-DiskImage 'D:\VHD\file.vhd' # VHD

Sida loo hubiyo .NET Framework versions rakibay la PowerShell?

Sidee si ay u hubiso haddii version .NET Framework 4.5 la geliyo la PowerShell?
(Get-ItemProperty -Path 'HKLM:\Software\Microsoft\NET Framework Setup\NDP\v4\Full' -EA 0).Version -like '4.5*'

Sidee si ay u bilaabaan oo ay joojiyaan qoraalka ah (in la abuuro rikoor ah fadhiga Windows PowerShell) la PowerShell?
Start-Transcript -Path 'C:\scripts\transcript.txt
Stop-Transcript

Sida loo beddelo buugga hadda meel gaar ah la PowerShell?
Set-Location -Path 'C:\scripts'

Sida loo kala cadeeyo shaashada la PowerShell?
Clear-Host
cls # Alias

Sida loo beddelo xal bandhigay la PowerShell ah?
Set-DisplayResolution -Width 1280 -Height 1024 -Force # Windows 2012

Sida loo dhigay “shaashad buuxda” uu furmo suuqa la PowerShell?
mode.com 300

Sidee si ay u helaan cabbir (ballaca iyo dhererka) ee sawir leh PowerShell?

Sida loo helo furaha Windows alaabta la PowerShell?

Perfmon

Sidee si ay u helaan “Time% processor” hadda (celcelis) ee 5 ilbiriqsi ee la soo dhaafay (10 jeer) la PowerShell?
(Get-Counter '\Processor(_total)\% Processor Time' -SampleInterval 5 -MaxSamples 10).CounterSamples.CookedValue

Assemblies

Sida loo shuban shirarkeeda la PowerShell?

Sida loo hubiyo shirarkeeda .NET hadda ku raran PowerShell?

Sida loo helo GAC (Global Golaha khasnado) Jidka la PowerShell?

Clipboard

Sida loo nuqul ka natiijooyinka si clipboard la PowerShell?

Sidee loo helaa content ee clipboard la PowerShell?
Add-Type -AssemblyName PresentationCore
[Windows.Clipboard]::GetText()

Hotfixes

Sidee loo helaa hotfixes ku rakiban la PowerShell?
Get-HotFix -ComputerName $computer

Sidee loo helaa hotfixes ku rakibay wixii ka horreeyey / ka dib taariikhda gaar ah la 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

Sidee si ay u hubiso haddii hotfix ah la geliyo la PowerShell?
Get-HotFix -Id KB2965142

Sidee loo helaa hotfixes ku rakiban computer fog la PowerShell?
Get-HotFix -ComputerName $computer

Pagefile

Sidee si ay u helaan macluumaad Pagefile la PowerShell?
Get-WmiObject -Class Win32_PageFileusage | Select-Object -Property Name, CurrentUsage, AllocatedBaseSize, PeakUsage, InstallDate

Sida loo helo xajmiga talinayaa (MB) ee Pagefile la PowerShell?
[Math]::Truncate(((Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory) / 1MB) * 1.5

Sida loo abuuro Pagefile ah (4096 MB) on (D 🙂 kaxayn la PowerShell?

Sidee in ay tirtirto Pagefile ku (C 🙂 kaxayn la PowerShell?

Maintenance

Sida loo hubiyo midnimo la’aan ah oo gaari ah la PowerShell?

Sida loo hubiyo meel disk ee drives la PowerShell?

Up


Files

Sida loo furo file ah la PowerShell?
Invoke-Item -Path 'C:\scripts\file.txt'
.'C:\scripts\file.txt'

Sida loo akhriyo file ah oo la PowerShell?
Get-Content -Path 'C:\scripts\file.txt'
gc "C:\scripts\file.txt" # Alias

Sida loo qoro wax soo saarka si ay u file ah oo la PowerShell?
'Line1', 'Line2', 'Line3' | Out-File -FilePath 'C:\scripts\file.txt'
'Line1', 'Line2', 'Line3' | Add-Content -Path file.txt

Sidee loo helaa fullname oo ka mid ah file script hadda la PowerShell?
$MyInvocation.MyCommand.Path

Sidee ku cadaadisaa / files zip la PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::CreateFromDirectory($folder,$fileZIP)

Sida loo uncompress / files siibka la PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::ExtractToDirectory($fileZIP, $folder)

Sidee si ay u arkaan files ee archive ZIP la PowerShell ah?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::OpenRead($fileZIP)

Sida loo soo bandhigo size ee file a in la KB PowerShell?
(Get-ChildItem -Path .\winsrv.dll).Length /1KB
(Get-ChildItem -Path .\winsrv.dll).Length /1MB
(Get-ChildItem -Path .\winsrv.dll).Length /1GB

Sida loo helo faylasha weyn ama ka yar 1 GB la PowerShell?

Sida loo soo bandhigo magaca file ah oo aan kordhin la PowerShell?
[System.IO.Path]::GetFileNameWithoutExtension('C:\Windows\system32\calc.exe') # Return calc

Sida loo soo bandhigo qandaraas kordhin ah oo file ah oo la PowerShell?
[System.IO.Path]::GetExtension('C:\scripts\file.txt') # Return .txt

Sidee loo helaa version file ah file ah oo la PowerShell ah?

Sidee loo helaa hash ee file ah la PowerShell?
(Get-FileHash $file).Hash

Sidee si ay u helaan dalbatay MD5 / SHA1 ee file ah oo la PowerShell?
Get-FileHash $file -Algorithm MD5
Get-FileHash $file -Algorithm SHA1

Sida loo soo bandhigo faylasha qarsoon la PowerShell?

Sidee si ay u hubiso haddii file ah ayaa qandaraaska u kordhiyey PowerShell?

Sida loo dhigay file ah sida “Kaliya akhri” la PowerShell?
Set-ItemProperty -Path .\file.txt -Name IsReadOnly -Value $true

Sida loo beddelo “LastWriteTime” sifo in toddobaadkii la soo dhaafay u file ah oo la PowerShell?
Set-ItemProperty -Path .\file.txt -Name LastWriteTime -Value ((Get-Date).AddDays(-7))
If not working, use Nirsoft tool: BulkFileChanger.

Sida loo abuuro file cusub PowerShell?
New-Item -ItemType File -Path 'C:\scripts\file.txt' -Value 'FirstLine'

Sida loo magaca file ah oo la PowerShell?
Rename-Item -Path 'C:\scripts\file.txt' -NewName 'C:\scripts\powershellguru2.txt'

Sida loo badan / Dufcaddii magaca files kala duwan leh PowerShell?
Get-ChildItem -Path C:\scripts\txt | Rename-Item -NewName { $_.Name -replace ' ', '_' }

Sidee in ay tirtirto file ah la PowerShell?
Remove-Item -Path 'C:\scripts\file.txt'

Sida loo soo bandhigo 10-ka khadadka ugu dambeeyay ee file ah oo la PowerShell?
Get-Content -Path 'C:\scripts\log.txt' -Tail 10

Sida loo unblock faylasha dhowr ah oo gal la PowerShell?
Get-ChildItem -Path 'C:\scripts\Modules' | Unblock-File

Sidee in ay ka saarto khadadka madhan ka file ah la PowerShell?
(Get-Content -Path file.txt) | Where-Object -FilterScript {$_.Trim() -ne '' } | Set-Content -Path file.txt

Sidee si ay u hubiso haddii file ka jira la PowerShell?

Sidee loo helaa / da’da weyn file cusub ee abuuray gal ah la PowerShell?

Sida loo ka file ah la PowerShell saarto khadadka nuqul?

Sidee loo helaa faylasha abuuray dheeraad ah ama ka yar 1 bil galka ah la PowerShell?

Sidee loo helaa faylasha abuuray dheeraad ah ama ka yar 1 sano galka ah la PowerShell?

Sida loo dhoofin qiimaha variable ah in file ah oo la PowerShell?
Set-Content -Path file.txt -Value $variable

Sida loo tiriyo tirada faylasha (* .txt) galka ah la PowerShell?

Sida loo raadin xarig ah gudaha files kala duwan leh PowerShell?
Select-String -Path 'C:\*.txt' -Pattern 'Test'

Sida loo soo bandhigaan / line ugu horeysay ee la soo dhaafay ee file ah oo la PowerShell?

Sida loo soo bandhigo tirada gaar ah line of file ah la PowerShell?

Sida loo tirin tirada layman file ah oo la PowerShell?

Sida loo tiriyo tirada jilayaasha iyo erayadii file ah oo la PowerShell?

Sida loo file la PowerShell?
Invoke-WebRequest -Uri 'http://www.nirsoft.net/utils/searchmyfiles.zip' -OutFile 'C:\tools\searchmyfiles.zip'

Sida loo soo bandhigo Jidka buuxda ee file ah la PowerShell?
Resolve-Path -Path .\script.ps1 # Return C:\Scripts\script.ps1

Copy

Sida loo nuqul ka mid file in gal ah la PowerShell?
Copy-Item -Path 'C:\source\file.txt' -Destination 'C:\destination'

Sida loo nuqul ka mid file inay fayl badan la PowerShell?

Sida loo nuqul ka files badan in hal folder la 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

Sida loo helo server Catalog Global ee Directory firfircoon la leh PowerShell?
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().GlobalCatalogs

Sida loo helo goobaha in Directory firfircoon la leh PowerShell?
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites

Sida loo helo qofka xukuma ee domain hadda la PowerShell?
(Get-ADDomainController).HostName

Sida loo helo oo dhan ilaaliyaal domain in domain ah oo la PowerShell ah?

Sida loo helo guuldarrada taranka AD la PowerShell?
Get-ADReplicationFailure dc02.domain.com # Windows 8 and 2012

Sida loo helo uu nool yahay Taalladaas waayo, kayntii adkayd in Directory firfircoon la leh PowerShell ah?

Sida loo helo faahfaahin kaynta / domain ee Directory firfircoon la leh PowerShell?

Sidee loo helaa Jidka “Waxyaabaha tirtiray” weelka in Directory firfircoon la leh PowerShell?
(Get-ADDomain).DeletedObjectsContainer

Sidee si ay awood AD feature Recycle Bin ee Directory firfircoon la leh PowerShell?

Sida loo soo celiyo Account AD ka Recycle Bin ee Directory firfircoon la leh PowerShell?
Get-ADObject -Filter 'samaccountname -eq "powershellguru"' -IncludeDeletedObjects | Restore-ADObject

Sida loo helo doorarka FSMO la PowerShell?

Sidee in ay ku xidhmaan xukuma gaar ah domain la PowerShell?
Get-ADUser -Identity $user -Server 'serverDC01'

Sidee loo helaa server ka logon hadda la PowerShell?

Sida loo sameeyo “gpupdate” kombiyuutarka ah la PowerShell?
Invoke-GPUpdate -Computer $computer -Force -RandomDelayInMinutes 0 # Windows 2012

Groups

Sida loo abuuro koox cusub ee Directory firfircoon la leh PowerShell?

Sidee in ay ka saarto koox ee Directory firfircoon la leh PowerShell?
Remove-ADGroup -Identity 'PowershellGuru'

Sida loo dar user a si koox ee Directory firfircoon la leh PowerShell?
Add-ADGroupMember "Powershell Guru" -Members powershellguru

Sidee in ay ka saarto user ka koox ee Directory firfircoon la leh PowerShell?
Remove-ADGroupMember 'Powershell Guru' -Members powershellguru

Sida loo helo kooxo madhan (xubnaha lahayn) in Directory firfircoon la leh PowerShell?
Get-ADGroup -Filter * -Properties Members | Where-Object -FilterScript {-not $_.Members}

Sidee loo tiriyo kooxaha madhan (xubnaha lahayn) in Directory firfircoon la leh PowerShell?
(Get-ADGroup -Filter * -Properties Members | Where-Object -FilterScript {-not $_.Members}).Count

Sidee si ay u helaan xubno ka mid ah koox ee Directory firfircoon la leh PowerShell?

Sidee si ay u helaan xubno ka mid ah koox xubnaha recursive in Directory firfircoon la leh PowerShell?

Sida loo tiriyo tirada xubnaha koox la / aan xubnaha recursive in Directory firfircoon la leh PowerShell?

Users

Sida loo isticmaalo xulashada ah in filter ee “Get-ADUser” ee Directory firfircoon la leh PowerShell?

Sidee u dhaqaaqo user a si shaqeeya kale ee Directory firfircoon la leh PowerShell?
Move-ADObject -Identity $dn -TargetPath 'OU=myOU,DC=domain,DC=com'

Sida loo helo dhammaan xubnaha in ay yihiin (Nested) ee user a la PowerShell?
Get-ADGroup -LDAPFilter "(member:1.2.840.113556.1.4.1941:=$($dn))"

Sidee loo helaa Xubnaha (gaaban magaca / keenin) ee user a la PowerShell?
(Get-ADUser $user -Properties MemberOf).MemberOf | ForEach-Object -Process {($_ -split ',')[0].Substring(3)} | Sort-Object

Sida loo magaca Magaca (FullName), (DisplayName), GivenName (FirstName), iyo Magac (LastName) ee koontada ee Directory firfircoon la leh PowerShell?

Sidee in la beddelo Description, Xafiiska, iyo lambarka telefoonka xisaab user ee Directory firfircoon la leh PowerShell?
Set-ADUser $samAccountName -Description 'IT Consultant' -Office 'Building B' -OfficePhone '12345'

Sida loo dhigay taariikhda uu dhacayo in “31/12/2015” ama “Marna” xisaab user ee Directory firfircoon la leh PowerShell?

Sida loo furo xisaab user in Directory firfircoon la leh PowerShell ah?
Unlock-ADAccount $samAccountName

Sidee si ay awood / gab koonto cusub Directory firfircoon la leh PowerShell?

Sidee in ay ka saarto koonto cusub Directory firfircoon la leh PowerShell?
Remove-ADUser $samAccountName

Sida loo joojiyo oo sirta ah xisaab mid user in Directory firfircoon la leh PowerShell?

Sida loo joojiyo oo sirta ah dhowr xisaab user (bulk) ee Directory firfircoon la leh PowerShell?

Sida loo helo milkiilaha file a in Directory firfircoon la leh PowerShell?

Sida loo helo shaqeeya ah (Unit ee hayadaha) ee ah user in Directory firfircoon la leh PowerShell?
[regex]::match("$((Get-ADUser $user -Properties DistinguishedName).DistinguishedName)",'(?=OU=)(.*\n?)').value

Sida loo helo xisaab user dadka naafada ah ee Directory firfircoon la leh PowerShell?

Sida loo helo xisaab user dhacay in Directory firfircoon la leh PowerShell?
Search-ADAccount -AccountExpired

Sida loo helo xisaab user qufulan ee Directory firfircoon la leh PowerShell?
Search-ADAccount -LockedOut

Sida loo helo SID ee koonto cusub Directory firfircoon la leh PowerShell?
(Get-ADUser $user -Properties SID).SID.Value

Sida loo badalo username ah in SID in Directory firfircoon la leh PowerShell?

Sida loo badalo SID ah in username in Directory firfircoon la leh PowerShell?

Sidee in aan kala tagno Magaca Distinguished ee koontada ee Directory firfircoon la leh PowerShell ah?

Sida loo helo taariikhda abuurniinta / beddelaad koonto cusub Directory firfircoon la leh PowerShell?
Get-ADUser -Identity $user -Properties whenChanged, whenCreated | Format-List -Property whenChanged, whenCreated

Sida loo soo bandhigo hantida optional oo khasab ah fasalka “User” ee Directory firfircoon la leh PowerShell?

Sida loo helo waddo LDAP ah user in Directory firfircoon la leh PowerShell ah?

Sida loo beddelo CN (qaadanin Name) ee ah user in Directory firfircoon la leh PowerShell?
Rename-ADObject $((Get-ADUser $user -Properties DistinguishedName).DistinguishedName) -NewName 'Test Powershell'

Sidee loo helaa Unugga ururka (OU) waalidka ee ku user in Directory firfircoon la leh PowerShell?

Sida loo helo milkiilaha a user (yaa abuuray account) ee Directory firfircoon la leh PowerShell?

Sida loo badalo sifo PwdLastSet u user in Directory firfircoon la leh PowerShell?

Computers

Sidee si ay u tijaabiso channel ka aamin ka dhexeeya computer maxalliga ah iyo domain la PowerShell?
Test-ComputerSecureChannel

Sidee si ay u cusboonaysiiyaan channel ka aamin ka dhexeeya computer maxalliga ah iyo domain la PowerShell?
Test-ComputerSecureChannel -Repair

Sida loo gab account computer ee Directory firfircoon la leh PowerShell ah?
Disable-ADAccount $computer

Sida loo helo kombiyuutarada la Operating Systems gaarka ah ee Directory firfircoon la leh PowerShell?

Organizational Unit (OU)

Sida loo abuuro Unit ah ururada (OU) ee Directory firfircoon la leh PowerShell?
New-ADOrganizationalUnit -Name 'TEST' -Path 'DC=domain,DC=com'

Sidee loo helaa Unit ururka (OU) tafaasiisha Active Directory la PowerShell?
Get-ADOrganizationalUnit 'OU=TEST,DC=domain,DC=com' -Properties *

Sida loo beddelo sharaxaad ka mid ah Unit ah ururada (OU) ee Directory firfircoon la leh PowerShell?
Set-ADOrganizationalUnit 'OU=TEST,DC=domain,DC=com' -Description 'My description'

Sidee si ay awood / gab Unit ah ururada (OU) ka tirtirka shil ah ee Directory firfircoon la leh PowerShell?

Sidee si ay awood Kabcada_ shil ah ee dhammaan Unit ee ururka (OU) ee Directory firfircoon la leh PowerShell?

Sidee in ay tirtirto Unit ee hayadaha ah (OU) ilaaliyey tirtirka shil ah ee Directory firfircoon la leh PowerShell?

Sida loo badalo Magaca a Distinguished of Unit ah ururada (OU) si qaadanin Magaca in Directory firfircoon la leh PowerShell?

Sidee inay taxaan qaybaha haya’adda madhan (oo halis ah) la PowerShell?

Sida loo helo tababare u ahaa koox la PowerShell?
(Get-ADGroup $dn -Properties Managedby).Managedby

Up


Regex (Regular Expression)

Sida loo soo saaro ah V4 Ciwaanka IP: ga (80.80.228.8) la Regex la 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

Sida loo soo saaro cinwaan MAC (C0-D9-62-39-61-2D) la separator “-” la Regex la 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

Sida loo soo saaro cinwaan MAC (C0: D9: 62: 39: 61: 2D) la separator “:” la Regex la 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

Sida loo soo saaro taariikh (10/02/2015) la Regex la PowerShell?
$example = 'The date is 10/02/2015'
$date = [regex]::match($example,'(\d{2}\/\d{2}\/\d{4})').value

Sida loo soo saaro URL ah (www.powershell-guru.com) la Regex la PowerShell?
$example = 'The URL is www.powershell-guru.com'
$url = [regex]::match($example,'[a-z]+[:.].*?(?=\s)').value

Sida loo soo saaro email ah (user@domain.com) la Regex la 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

Sida loo soo saaro “Galliani” ka tusaale xarig la Regex la PowerShell ah?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=-)(.*\n?)(?=.com)').value

Sida loo soo saaro “guru.com” ka tusaale xarig la Regex la PowerShell ah?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=-)(.*\n?)(?<=.)').value

Sida loo soo saaro “powershell-guru.com” ka tusaale xarig la Regex la PowerShell ah?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=www.)(.*\n?)').value

Sida loo soo saaro “123” oo ka tusaale xarig la Regex la PowerShell ah?
$example = 'Powershell123'
[regex]::match($example,'(\d+)').value

Sida loo soo saaro “$” (calaamad dollar) ka tusaale xarig la Regex la PowerShell ah?
$example = 'Powershell`$123'
[regex]::match($example,'(\$)').value

Sida loo badalo qof (* .com) iyo mid kale (* .fr) oo xarig ah la Regex la PowerShell?
$example = 'www.powershell-guru.com'
[regex]::Replace($example, '.com','.fr')

Sidee si ay uga baxsadaan xarig ah la Regex la PowerShell?
[regex]::Escape('\\server\share')

Up


Memory

Sida loo qasbi ah ururinta xasuusta by ururiyaha qashinka la PowerShell ah?
[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()

Sidee loo helaa size RAM ee kombiyuutar la PowerShell ah?

Up


Date

Sida loo helo taariikhda hadda la PowerShell?
Get-Date
[Datetime]::Now

Sida loo soo bandhigaan taariikhda qaabab kala duwan la PowerShell?

Sida loo badalo taariikh (Datetime) si ay taariikh (String) la PowerShell?
$datetimeToString = '{0:dd/MM/yy}' -f (Get-Date 30/01/2015)
$datetimeToString = (Get-Date 31/01/2015).ToShortDateString()

Sida loo badalo taariikh (String) si ay taariikh (Datetime) la PowerShell?
$stringToDatetime = [Datetime]::ParseExact('30/01/2015', 'dd/MM/yyyy', $null)

Sidee si ay u xisaabiso faraqa u (Tirada Maalmaha, Saacadaha, Minutes, ama seconds) inta u dhaxaysa laba taariikhaha la 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

Sidee inay is barbar dhigaan laba taariikhaha la 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

Sida loo kala sooco soo diyaariyeen ah oo timir ah sida “Datetime” la PowerShell?
$arrayDate | Sort-Object -Property {$_ -as [Datetime]}

Sidee si ay u bilaabaan oo ay joojiyaan stopwatch ah la PowerShell?
$chrono = [Diagnostics.Stopwatch]::StartNew()
$chrono.Stop()
$chrono

Sidee loo helaa maalinta hadda ee toddobaadka la PowerShell?
(Get-Date).DayOfWeek #Sunday

Sida loo helo taariikhda shalay la PowerShell?
(Get-Date).AddDays(-1)

Sida loo helo tirada maalmaha bisha (in February 2015) la PowerShell?
[DateTime]::DaysInMonth(2015, 2)

Sida loo ogaado sano ah u boodboodi la PowerShell?
[DateTime]::IsLeapYear(2015)

Sidee inay taxaan goobaha waqtiga la PowerShell?
[System.TimeZoneInfo]::GetSystemTimeZones()

Up


Networking

Sida loo encode (in qaab ASCII) oo uu kelmadaha URL ah la PowerShell?

Waa maxay u dhigma of amarrada network hooyo la PowerShell?

Sidee loo helaa cinwaanada IP la PowerShell?
Get-NetIPAddress # Windows 8.1 & Windows 2012
Get-NetIPConfiguration # Windows 8.1 & Windows 2012

Sida loo gab IP address v6 (IPv6) la PowerShell?

Sida loo ansixiyo V4 Ciwaanka IP: ga ah (IPv4) la PowerShell?
if([ipaddress]'10.0.0.1'){'validated'}

Sida loo helo cinwaanka IP dibadda la PowerShell?

Sida loo helo Hostname ka Ciwaanka IP: ga la PowerShell?
([System.Net.Dns]::GetHostEntry($IP)).Hostname

Sida loo helo cinwaanka IP ka Hostname ah la PowerShell?
([System.Net.Dns]::GetHostAddresses($computer)).IPAddressToString

Sida loo helo FQDN ka Hostname ah la PowerShell?
[System.Net.Dns]::GetHostByName($computer).HostName

Sida loo helo qaabeynta network (IP, Subnet, Gateway, iyo DNS) la PowerShell?

Sida loo helo cinwaanka MAC la PowerShell?
Get-CimInstance win32_networkadapterconfiguration | Select-Object -Property Description, Macaddress
Get-WmiObject -Class win32_networkadapterconfiguration | Select-Object -Property Description, Macaddress

Sida loo Ping kombiyuutar la PowerShell?

Sidee si ay u hubiso haddii computer la xiran internetka la PowerShell?

Sida loo sameeyo a “WHOIS” Lookup u website qaba PowerShell?
$whois = New-WebServiceProxy 'http://www.webservicex.net/whois.asmx?WSDL'
$whois.GetWhoIs('powershell-guru.com')

Sida loo helo faahfaahinta IP dadweynaha (geolocation) la PowerShell?

Sidee si ay u hubiso haddii dekedda ah u furan yahay / la xidhay la PowerShell?
New-Object -TypeName Net.Sockets.TcpClient -ArgumentList $computer, 135

Sida loo sameeyo “tracert” la PowerShell?
Test-NetConnection www.google.com -TraceRoute

Sida loo hagaajin la xidhiidha profile network guri la PowerShell?
Get-NetAdapter | Format-Table -Property Name, InterfaceDescription, ifIndex -AutoSize # Windows 8.1
Set-NetConnectionProfile -InterfaceIndex 6 -NetworkCategory Private

Sidee si ay u muujiyaan isku xirka dekedda TCP la PowerShell?
netstat.exe -ano
Get-NetTCPConnection #Windows 8 and 2012

Sida loo soo gaabin URL dheer URL yar la PowerShell galay?
$url = 'www.powershell-guru.com'
$tiny = Invoke-RestMethod -Uri "http://tinyurl.com/api-create.php?url=$url"

Sida loo helo goobaha wakiil la PowerShell?
Get-ItemProperty -Path HKCU:"Software\Microsoft\Windows\CurrentVersion\Internet Settings"

DNS

Sida loo hubiyo khasnado DNS ee kombiyuutarka deegaanka la PowerShell?
ipconfig.exe /displaydns
Get-DnsClientCache #Windows 8 and 2012

Sida loo kala cadeeyo khasnado DNS on computer maxali ah oo la PowerShell ah?
ipconfig.exe /flushdns
Start-Process -FilePath ipconfig -ArgumentList /flushdns -WindowStyle Hidden
Clear-DnsClientCache #Windows 8 and 2012

Sida loo kala cadeeyo khasnado DNS on kombiyuutarada fog la PowerShell ah?
Invoke-Command -ScriptBlock {Clear-DnsClientCache} -ComputerName computer01, computer02

Sida loo akhriyo ciidammadu ku soo gudbin la PowerShell?
Get-Content -Path 'C:\Windows\system32\drivers\etc\hosts'

Up


Password

Sidee in ay curiyaan sirta ah random la PowerShell?
[Reflection.Assembly]::LoadWithPartialName('System.Web')
[System.Web.Security.Membership]::GeneratePassword(30,2)

Sida loo beddelo sirta ah ee degmadaada maamulka on server fog la PowerShell?
$admin = [ADSI]('WinNT://server01/administrator,user')
$admin.SetPassword($password)
$admin.SetInfo()

Sida loo helo taariikhda uu dhacayo password koonto ku Directory firfircoon la leh PowerShell?

Up


Printers

Sida loo qor dhamaan madbacadaha ee server gaar ah la PowerShell?
Get-WmiObject -Query 'Select * From Win32_Printer' -ComputerName $computer

Sidee inay taxaan oo dhan dekedaha ee server gaar ah la PowerShell?
Get-WmiObject -Class Win32_TCPIPPrinterPort -Namespace 'root\CIMV2' -ComputerName $computer

Sida loo beddelo comment / goobta printer ah la PowerShell?

Sidee loo daahiriyo (diido dhamaan shaqooyinka) lagu daabaco la PowerShell?
$printer = Get-WmiObject -Class win32_printer -Filter "Name='HP Deskjet 2540 series'"
$printer.CancelAllJobs()

Sida loo daabacan page baaritaan loogu talagalay in printer ah la PowerShell?
$printer = Get-WmiObject -Class win32_printer -Filter "Name='HP Deskjet 2540 series'"
$printer.PrintTestPage()

Sida loo helo safafka print u madbacadaha la PowerShell?

Up


Regedit

Read

Sidee inay taxaan finan diiwaanka la PowerShell?
Get-ChildItem -Path Registry::

Sida loo helo qiimaha diiwaanka iyo noocyada qiimaha la PowerShell?

Sida loo liiska muhiim ah subkeys la PowerShell?

Sidee inay taxaan subkeys muhiim ah diiwaanka hab recursive la PowerShell?
Get-ChildItem -Path 'HKLM:\SYSTEM' -Recurse -ErrorAction SilentlyContinue

Sida loo helo subkeys la magac gaar ah la PowerShell?
Get-ChildItem -Path 'HKLM:\SOFTWARE' -Include *Plugin* -Recurse -ErrorAction SilentlyContinue

Sidee inuu ku soo laabto oo keliya magaca subkeys diiwaanka la PowerShell ah?
(Get-ChildItem -Path 'HKLM:\SYSTEM').Name # Return HKEY_LOCAL_MACHINE\SYSTEM\ControlSet
Get-ChildItem -Path 'HKLM:\SYSTEM' -Name # Return ControlSet

Sida loo qor qiimaha diiwaanka la PowerShell?
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'

Sida loo akhriyo qiimo gaar ah diiwaanka la PowerShell?
(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ProductName

Sida loo akhriyo qiimo gaar ah diiwaanka kombiyuutarka fog la PowerShell?

Write

Sidee si ay u abuuraan fure cusub oo diiwaanka la PowerShell?
New-Item -Path 'HKCU:\Software\MyApplication'

Sida loo abuuro qiimaha diiwaanka la PowerShell ah?
New-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version' -Value '1.0'

Sidee inuu wax ka beddelo lagu qiimeeyay diiwaangelinta ee hadda jira la PowerShell?
Set-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version' -Value '2.0'

Delete

Sidee in ay tirtirto qiimaha diiwaanka la PowerShell ah?
Remove-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version'

Sidee in ay tirtirto muhiim ah diiwaanka la PowerShell ah?
Remove-Item -Path 'HKCU:\Software\MyApplication' -Force

Test

Sidee u ah inay tijaabiso hadii muhiim ah diiwaanka ah la PowerShell ka jira?
Test-Path -Path 'HKCU:\Software\MyApplication'

Sidee u ah inay tijaabiso hadii qiimaha diiwaanka ka jira la PowerShell?
(Get-Item -Path 'HKCU:\Software\MyApplication').GetValueNames() -contains 'Version'

Up


Strings

Sidee in ay ka saarto cad-meel characters tan iyo bilowgii xarig ah la PowerShell?
$string = ' PowershellGuru'
$string = $string.TrimStart()

Sidee in ay ka saarto cad-meel characters ka dhamaadka xarig ah la PowerShell?
$string = 'PowershellGuru '
$string = $string.TrimEnd()

Sidee in ay ka saarto cad-meel characters (bilow ilaa dhamaad) ee xarig ah la PowerShell?
$string = ' PowershellGuru '
$string = $string.Trim()

Sida loo badalo xarig ah in kiiska sare leh PowerShell?
$string = 'powershellguru'
$string = $string.ToUpper()

Sida loo badalo xarig ah in ay hoos u dhacdo in la PowerShell?
$string = 'POWERSHELLGURU'
$string = $string.ToLower()

Sidee in ay doortaan substring “PowerShell” ee xadhigga “PowerShellGuru” la PowerShell?
$string.Substring(0,10)

Sidee in ay doortaan substring ah “Guru” ee xadhigga “PowerShellGuru” la PowerShell?
$string.Substring(10)

Sidee in ay doortaan tirada “123” oo ah “PowerShell123Guru” la PowerShell?
$string = 'Powershell123Guru'
[regex]::match($string,'(\d+)').value

Sidee loo helaa index ah eber ku salaysan ee “Guru” ee “PowerShellGuru” xarig la PowerShell?
$string.IndexOf('Guru') # 10

Sidee si ay u hubiso haddii xarig ah waa waxba kama ama madhan la PowerShell?
$string = $null
$string = ''
[string]::IsNullOrEmpty($string)

Sidee si ay u hubiso haddii xarig ah waa waxba, madhan, ama kooban yahay oo kaliya cad-meel characters la PowerShell?
$string = $null
$string = ''
$string = ' '
[string]::IsNullOrWhiteSpace($string)

Sidee si ay u hubiso haddii xarig ah ku jira warqad gaar ah oo la PowerShell?
$string = 'PowershellGuru'
$string.Contains('s')
[regex]::match($string,'s').Success

Sidee inuu ku soo laabto dhererka xarig ah la PowerShell?
$string.Length

Sida loo concatenate laba xadhig la PowerShell?

Sida loo dhigma hal ama dhowr qaansada “[]” in xarig ah la PowerShell?
$string = '[PowershellGuru]'
$string -match '\[' # Only 1
$string -match '\[(.*)\]' # Several

Sida loo dhigma hal ama dhowr parentheses “()” oo xarig ah la PowerShell?
$string = '(PowershellGuru)'
$string -match '\(' # Only 1
$string -match '\((.*)\)' # Several

Sida loo dhigma hal ama dhowr qaansada ku kuweyga “{}” in xarig ah la PowerShell?
$string = '{PowershellGuru}'
$string -match '\{' # Only 1
$string -match '\{(.*)\}' # Several

Sida loo dhigma hal ama dhowr qaansada ku xagal “<>” in xarig ah la PowerShell?
$string = ''
$string -match '\<' # Only 1
$string -match "\<(.*)\>" # Several

Sida loo dhigma wax xarfaha (ABC) oo xarig ah la PowerShell?
$string = 'POWERSHELLGURU'
$string -cmatch "^[a-z]*$" #False

Sida loo dhigma wax upperletters (ABC) oo xarig ah la PowerShell?
$string = 'powershellguru'
$string -cmatch "^[A-Z]*$" #False

Sida loo dhigma “[p” (p kiiska hoose) in xarig ah la PowerShell?
$string = '[powershellGuru]'
$string -cmatch '\[[a-z]\w+' #True

Sida loo dhigma “[P” (P kiiska sare) in xarig ah la PowerShell?
$string = '[PowershellGuru]'
$string -cmatch '\[[A-Z]\w+' #True

Sida loo bedelo line ku haysta xadhig kale la PowerShell?
$a = 'Line A'
$b = 'Line B'
$a = $a -replace $a, $b

Sida loo badalo howlgalka kala qaybsameen in xarig ah (boqolkiiba) la PowerShell?
(1/2).ToString('P')

Sida loo kala sooco xadhig ka kooban tirooyin leh PowerShell?

Sidee in ay doortaan hadalka ee la soo dhaafay xukun la PowerShell?
$sentence = 'My name is Test Powershell'
$sentence.Split(' ')[-1] # Returns Powershell

Sida loo helo erayga ugu weyn ee xukun la PowerShell?
$sentence = 'My name is Test Powershell'
$sentence.Split(' ') | Sort-Object -Property Length | Select-Object -Last 1 # Returns Powershell

Sida loo tirin tirada jeer xarig ah waa hadiyad xukun la PowerShell gudahooda?
$sentence = 'test test test Powershell'
[regex]::Matches($sentence, 'test').Count # Returns 3

Sida loo nuqul ka qof kasta oo xarig ah in qof la dagaallamaan ah la PowerShell?

Sida loo badalo xarafka ugu horeeya si ay u waawayn ee xarig ah la PowerShell?

Sida loo gashto (bidix ama midig) oo xarig ah la PowerShell?

Sida loo encode iyo kelmadaha xarig ah in Base64 la PowerShell?

Sida loo badalo dhawr ah (iyo ka) binary la PowerShell?

Sidee inuu ku soo laabto kaliya folder waalidka ee la soo dhaafay waddo la PowerShell?

Sidee inuu ku soo laabto kaliya shayga ugu danbeysay ee ay waddo la PowerShell?

Up


Math

Sida loo qor hababka fasalka System.Math la PowerShell?
[System.Math] | Get-Member -Static -MemberType Method

Sidee inuu ku soo laabto qiimaha buuxda la PowerShell?
[Math]::Abs(-12) #Returns 12
[Math]::Abs(-12.5) # Returns 12.5

Sidee inuu ku soo laabto ka leexdo oo Culumida Soomaaliyeed waa tirada cayiman la PowerShell?
[Math]::ASin(1) #Returns 1,5707963267949

Sidee inuu ku soo laabto qiimaha saqafkiisa PowerShell ah?
[Math]::Ceiling(1.4) #Returns 2
[Math]::Ceiling(1.9) #Returns 2

Sidee inuu ku soo laabto qiimaha dabaqa la PowerShell ah?
[Math]::Floor(1.4) #Returns 1
[Math]::Floor(1.9) #Returns 1

Sidee inuu ku soo laabto dabiiciga ah (saldhig e) logarithm tirada cayiman la PowerShell?
[Math]::Log(4) #Returns 1,38629436111989

Sidee inuu ku soo laabto saldhigga 10 logarithm tiro cayiman la PowerShell?
[Math]::Log10(4) #Returns 0,602059991327962

Sidee inuu ku soo laabto ugu badnaan laba qiimaha la PowerShell?
[Math]::Max(2,4) #Returns 4
[Math]::Max(-2,-4) #Returns -2

Sidee inuu ku soo laabto ugu yaraan laba qiimaha la PowerShell?
[Math]::Min(2,4) #Returns 2
[Math]::Max(-2,-4) #Returns -4

Sidee inuu ku soo laabto tiro sara kiciyey si ay awood cayiman la PowerShell?
[Math]::Pow(2,4) #Returns 16

Sidee inuu ku soo laabto qiimaha tobanle in qiimaha ugu dhow muhiim ah la PowerShell?
[Math]::Round(3.111,2) #Returns 3,11
[Math]::Round(3.999,2) #Returns 4

Sidee inuu ku soo laabto qaybta muhiim ah oo tiro cayiman jajab tobanle leh PowerShell?
[Math]::Truncate(3.111) #Returns 3
[Math]::Truncate(3.999) #Returns 3

Sidee inuu ku soo laabto xididka laba jibbaaran tiro cayiman la PowerShell?
[Math]::Sqrt(16) #Returns 4

Sidee inuu ku soo laabto joogto PI la PowerShell ah?
[Math]::Pi #Returns 3,14159265358979

Sidee inuu ku soo laabto saldhigga logardam dabiiciga ah (joogto ah e) la PowerShell?
[Math]::E #Returns 2,71828182845905

Sidee si ay u hubiso haddii tiro xitaa ama cajiib ah la PowerShell?
[bool]($number%2)

Up


Hashtables

Sida loo abuuro hashtable madhan la PowerShell?
$hashtable = @{}
$hashtable = New-Object -TypeName System.Collections.Hashtable

Sida loo abuuro hashtable qaba waxyaabaha la PowerShell?

Sida loo abuuro hashtable ah by muhiimka ah / Magaca (dictionary ku amartay) soocaa leh waxyaabaha la PowerShell?

Sidee ku darto waxyaabaha (labada ciyaaryahan muhiim ah qiimaha) si hashtable ah la PowerShell?
$hashtable.Add('Key3', 'Value3')

Sida loo helo qiimaha gaarka ah ee hashtable ah la PowerShell?
$hashtable.Key1
$hashtable.Get_Item('Key1')

Sida loo helo qiimaha ugu yar ee hashtable ah la PowerShell?

Sida loo helo qiimaha ugu badan ee hashtable ah la PowerShell?

Sidee inuu wax ka beddelo alaabta ee hashtable ah la PowerShell?
$hashtable.Set_Item('Key1', 'Value1Updated')

Sidee inuu ka saaro waxyaabaha ku hashtable ah la PowerShell?
$hashtable.Remove('Key1')

Sida loo kala cadeeyo hashtable ah la PowerShell?
$hashtable.Clear()

Sida loo hubiyo jiritaanka muhiim ah / qiimaha gaarka ah ee hashtable ah la PowerShell?
$hashtable.ContainsKey('Key3')
$hashtable.ContainsValue('Value3')

Sida loo kala sooco by muhiimka ah / qiimaha ee hashtable ah la PowerShell?
$hashtable.GetEnumerator() | Sort-Object -Property Name
$hashtable.GetEnumerator() | Sort-Object -Property Value -Descending

Up


Arrays

Sidee si ay u abuuraan dagaal isugu diyaariyeen madhan la PowerShell?
$array = @()
$array = [System.Collections.ArrayList]@()

Sidee si ay u abuuraan dagaal isugu diyaariyeen la alaabta la PowerShell?
$array = @('A', 'B', 'C')
$array = 'A', 'B', 'C'
$array = 'a,b,c'.Split(',')
$array = .{$args} a b c
$array = echo a b c

Sida loo waxyaabaha lagu daro in la dagaallamaan la PowerShell?
$array += 'D'
[void]$array.Add('D')

Sidee inuu wax ka beddelo shay soo diyaariyeen la PowerShell?
$array[0] = 'Z' # 1st item[0]

Sida loo hubiyo size ee soo diyaariyeen la PowerShell?
$array = 'A', 'B', 'C'
$array.Length # Returns 3

Sida loo soo ceshano hal shay / dhowr ah oo dhan alaabta / diyaariyeen la PowerShell?
$array = @('A', 'B', 'C')
$array[0] # One item (A)
$array[0] + $array[2] # Several items (A,C)
$array # All items (A,B,C)

Sidee inuu ka saaro waxyaabaha madhan soo diyaariyeen la PowerShell?
$array = @('A', 'B', 'C', '')
$array = $array.Split('',[System.StringSplitOptions]::RemoveEmptyEntries) | Sort-Object # A,B,C

Sidee si ay u hubiso haddii shay jirta soo diyaariyeen la PowerShell?
$array = @('A', 'B', 'C')
'A' | ForEach-Object -Process {$array.Contains($_)} # Returns True
'D' | ForEach-Object -Process {$array.Contains($_)} # Returns False

Sida loo helo tirada index shay soo diyaariyeen la PowerShell?
$array = @('A', 'B', 'C')
[array]::IndexOf($array,'A') # Returns 0

Sidee u ah dib-amarka ah waxyaabaha soo diyaariyeen la PowerShell?
$array = @('A', 'B', 'C')
[array]::Reverse($array) # C,B,A

Sidee si ay wax nasiib ah laga soo diyaariyeen la PowerShell?
$array | Get-Random

Sida loo kala sooco soo diyaariyeen ah oo kor u kacaya / hab soo degaya la PowerShell?
$array = @('A', 'B', 'C')
$array | Sort-Object # A,B,C
$array | Sort-Object -Descending # C,B,A

Sida loo tirin tirada alaabta soo diyaariyeen la PowerShell?
$array.Count

Sida loo dar soo diyaariyeen ah midka kale kula PowerShell?
$array1 = 'A', 'B', 'C'
$array2 = 'D', 'E', 'F'
$array3 = $array1 + $array2 # A,B,C,D,E,F

Sida loo helo tus ka soo diyaariyeen la PowerShell?
$array = 'A', 'B', 'C', 'C'
($array | Group-Object | Where-Object -FilterScript {$_.Count -gt 1}).Values # Returns C

Sida loo ka la dagaallamaan la PowerShell saarto tus?
$array = 'A', 'B', 'C', 'C'
$array = $array | Select-Object -Unique
$array # Returns A,B,C

Sidee si ay u abuuraan dagaal isugu diyaariyeen la alaabta laga bilaabo horgale (“user01”, “user02”, … “user10”) la PowerShell?
$array = 1..10 | ForEach-Object -Process { "user$_" }

Up


ACL

Sidee inaad Liiska ku gil gilay warka ee user AD la PowerShell?
(Get-Acl -Path "AD:\$dn").Access

Sidee inaad Liiska ku gil gilay warka of gal ah la PowerShell?
(Get-Acl -Path C:\scripts).Access

Sidee inay taxaan entries gaar ah fasax gil gilay warka (isticmaala ama kooxaha) ee user AD ah la PowerShell?

Up


Variables

Waa maxay noocyada macluumaadka ugu badan ee la PowerShell?

Sida loo helo ugu yaraan iyo ugu badnaan qiimaha doorsoomeyaasha nooca qaar ka mid ah la PowerShell?

Sidee si ay u tijaabiso datatype la PowerShell?

Sida loo abuuro Halkan-darrooyin is variable la PowerShell?

Sida loo abuuro variable ah oo la PowerShell?
$powershellGuru = 'Hello'

Sida loo abuuro variable ah oo joogto ah la PowerShell?
Set-Variable -Name powershellGuru -Value 2015 -Option Constant

Sida loo abuuro variable caalami ah oo PowerShell?
$Global:powershellGuru = 'Hello'

Sida loo akhriyo variable ah oo la PowerShell?
$powershellGuru = 'Hello' # Create