AWON IBEERE IGBAGBOGBO NIPA POWERSHELL

By | May 23, 2015

translated-yoruba


Erongba : Awọn Ibeere igbagbogbo nipa PowerShell.

O le lo ri akojọ yi ni ona ti o yatọ :

  • Lati daakọ / lati lẹẹ ipase sinu akosile
  • Lati ri sintasi ni kiakia ni pato
  • Lati mu imọ rẹ tesiwaju
  • Lati še iwari ofin titun
  • Lati ṣeto iforowanilenuwo fun ise

Imuwasi ibamu
July 02, 2015
Olukowe powershell-guru.com
Orisun yoruba.powershell-guru.com
Isori
75
Awon ìbéèrè
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

Bawo ni a ṣe le mọ iru PowerShell?

Bawo ni a ṣe le mu PowerShell ṣiṣe ti iru miiran ti ibamu ti a teyin wa?
powershell.exe -Version 2.0

Bawo ni a ṣe le beere fun iru PowerShell iwonba (3.0 ati eyi ti o ga) ni akosile pẹlu PowerShell?
#Requires -Version 3.0

Bawo ni a ṣe le beere fun isakoso anfaani akosile pẹlu PowerShell?

Bawo ni a ṣe le ṣe ayẹwo awọn akosile pẹlu PowerShell?
help -Name .\Get-ExchangeEnvironmentReport.ps1 -Full

Bawo ni a se le gba alaye fun awọn ti o nlo PowerShell?
[Security.Principal.WindowsIdentity]::GetCurrent()

Bawo ni a ṣe le ṣ’ẹda, ṣatunkọ, ki o si tun profaili kojọ pẹlu PowerShell?

Bawo ni a ṣe le daa duro fun iseju aaya 5 / iṣẹju ni akosile pẹlu PowerShell?
Start-Sleep -Seconds 5
Start-Sleep -Seconds 300 # 5 minutes

Bawo ni a ṣe le ri akoko titan ti o gbeyin pẹlu PowerShell?
(Get-CimInstance -ClassName win32_operatingsystem).LastBootUpTime

Bawo ni a ṣe le ri awon iru imuyara pẹlu PowerShell?

Bawo ni a ṣe le ṣe akojọ awọn eto ibẹrẹ pẹlu PowerShell?

Bawo ni a ṣe le yoo ohun elo pẹlu PowerShell?

Bawo ni a ṣe le ya a sikirinifoto ti gbogbo komputa tabi windo ti nṣiṣe lọwọ pẹlu PowerShell?
Take-ScreenShot -Screen -File 'C:\scripts\screenshot.png' -Imagetype JPEG
Repository : Take-ScreenShot

Bawo ni a ṣe le gba awọn onka ifiranṣẹ fun MSMQ queues pẹlu PowerShell?

Bawo ni a ṣe le ṣ’eto awọn ipaniyan imulo pẹlu PowerShell?

Bawo ni a ṣe le ṣ’ẹda ọna abuja pẹlu PowerShell?

Bawo ni a ṣe le ṣe imumole tabi imukuro eto si amu ṣiṣe pẹlu PowerShell?

Bawo ni a ṣe le ṣii Windows Explorer pẹlu PowerShell?
[Diagnostics.Process]::Start('explorer.exe')
Invoke-Item -Path C:\Windows\explorer.exe

Bawo ni a ṣe le ṣe akojọ ẹrọ awakọ pẹlu PowerShell?
Get-WmiObject -Class Win32_PnPSignedDriver
Get-WindowsDriver -Online -All
driverquery.exe

Bawo ni a ṣe le ṣ’ẹda GUID kan pẹlu PowerShell?

Bawo ni a ṣe le ni awọn ipo ti awọn ibùgbé liana fun awọn ti isiyi olumulo pẹlu PowerShell?
[System.IO.Path]::GetTempPath()

Bawo ni a ṣe le dara pọ mọ ọna ati ọmọ kan sinu ni ọna ẹyọ kan pẹlu PowerShell?
Join-Path -Path C:\ -ChildPath \windows

Bawo ni a ṣe le ṣe akojọ gbogbo cmdlets “Ni- *” pẹlu PowerShell?
Get-Command -Verb Get

Bawo ni a ṣe le ṣe akojọ eto pataki awọn folda pẹlu PowerShell?

Bawo ni a ṣe le gbe awọn faili ISO / VHD òke pẹlu PowerShell?
Mount-DiskImage 'D:\ISO\file.iso' # ISO
Mount-DiskImage 'D:\VHD\file.vhd' # VHD

Bawo ni a ṣe le ṣe ṣayẹwo .NET ilana awọn ẹya sori ẹrọ pẹlu PowerShell?

Bawo ni a ṣe le ṣe ṣayẹwo ti o ba je pe .NET ilana ti ikede ti fi sori ẹrọ 4,5 pẹlu PowerShell?
(Get-ItemProperty -Path 'HKLM:\Software\Microsoft\NET Framework Setup\NDP\v4\Full' -EA 0).Version -like '4.5*'

Bawo ni a ṣe le bẹrẹ ati ki a da tiransikiripiti duro (lati ṣẹda kan gba ti Windows akoko PowerShell) pẹlu PowerShell?
Start-Transcript -Path 'C:\scripts\transcript.txt
Stop-Transcript

Bawo ni a ṣe le yi awọn isiyi liana pada si ibi kan pato ipo pẹlu PowerShell?
Set-Location -Path 'C:\scripts'

Bawo ni a ṣe le ko iboju kuro pẹlu PowerShell?
Clear-Host
cls # Alias

Bawo ni a ṣe le yi awọn ifihan giga pẹlu PowerShell?
Set-DisplayResolution -Width 1280 -Height 1024 -Force # Windows 2012

Bawo ni a ṣe le ṣeto awọn “iboju kikun” window pẹlu PowerShell?
mode.com 300

Bawo ni a ṣe le ni iru iwọn (fifẹ ati giga) ti aworan pẹlu PowerShell?

Bawo ni a ṣe le ni awọn ọja Windows bọtini pẹlu PowerShell?

Perfmon

Bawo ni a ṣe le ni awọn “% isise Akoko” isinyi (apapọ) ni 5 aaya seyin (10 igba) pẹlu PowerShell?
(Get-Counter '\Processor(_total)\% Processor Time' -SampleInterval 5 -MaxSamples 10).CounterSamples.CookedValue

Assemblies

Bawo ni a ṣe le ṣe akojọ apejọ pẹlu PowerShell?

Bawo ni a ṣe le ṣe ṣayẹwo lọwọlọwọ .NET apejo ti akojọpọ pẹlu PowerShell?

Bawo ni a ṣe le wa awọn GAC (Apejọ kaṣeAgbaye) pẹlu ona PowerShell?

Clipboard

Bawo ni a ṣe le se da esi si sileti pẹlu PowerShell?

Bawo ni a ṣe le gba awọn akoonu ti awọn sileti pẹlu PowerShell?
Add-Type -AssemblyName PresentationCore
[Windows.Clipboard]::GetText()

Hotfixes

Bawo ni a ṣe le ni awọn atunse gbigbona sori ẹrọ pẹlu PowerShell?
Get-HotFix -ComputerName $computer

Bawo ni a ṣe le ni awọn atunse gbigbona fifi sori ẹrọ ki o to / lẹhin kan pato ọjọ pẹlu 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

Bawo ni a ṣe le se ṣayẹwo ti a ba ti fi sori ẹrọ atunse gbigbona pẹlu PowerShell?
Get-HotFix -Id KB2965142

Bawo ni a ṣe le ni awọn atunse gbigbona fifi sori ẹrọ lori kọmputa kan pẹlu PowerShell?
Get-HotFix -ComputerName $computer

Pagefile

Bawo ni a ṣe le ni alaye lori Oju iwe faili pẹlu PowerShell?
Get-WmiObject -Class Win32_PageFileusage | Select-Object -Property Name, CurrentUsage, AllocatedBaseSize, PeakUsage, InstallDate

Bawo ni a ṣe le ni awọn igbani niyanju iwọn (MB) fun awọn Ojuiwe faili pẹlu PowerShell?
[Math]::Truncate(((Get-WmiObject -Class Win32_ComputerSystem).TotalPhysicalMemory) / 1MB) * 1.5

Bawo ni a ṣe le ṣẹda Oju iwe faili kan (4096 MB) lori (D 🙂 pẹlu PowerShell?

Bawo ni a ṣe le pa Oju iwe faili rẹ lori (C 🙂 pẹlu PowerShell?

Maintenance

Bawo ni a ṣe le ṣayẹwo awọn Apola ti lilo pẹlu PowerShell?

Bawo ni a ṣe le ṣayẹwo awọn aaye disk ti draifu pẹlu PowerShell?

Up


Files

Bawo ni a ṣe le ṣii faili pẹlu PowerShell?
Invoke-Item -Path 'C:\scripts\file.txt'
.'C:\scripts\file.txt'

Bawo ni a ṣe le ka faili pẹlu PowerShell?
Get-Content -Path 'C:\scripts\file.txt'
gc "C:\scripts\file.txt" # Alias

Bawo ni a ṣe le kọ o wu si faili kan pẹlu PowerShell?
'Line1', 'Line2', 'Line3' | Out-File -FilePath 'C:\scripts\file.txt'
'Line1', 'Line2', 'Line3' | Add-Content -Path file.txt

Bawo ni a ṣe le ni awọn orukọkinkun ti akosile faili isinyi pẹlu PowerShell?
$MyInvocation.MyCommand.Path

Bawo ni a ṣe le ṣe ifunpọ / sipu awọn faili pẹlu PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::CreateFromDirectory($folder,$fileZIP)

Bawo ni a ṣe le ṣe aifunpọ / aisipu awọn faili pẹlu PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::ExtractToDirectory($fileZIP, $folder)

Bawo ni a ṣe le ri awọn faili ni a SIP pamosi pẹlu PowerShell?
Add-Type -AssemblyName 'System.IO.Compression.Filesystem'
[System.IO.Compression.ZipFile]::OpenRead($fileZIP)

Bawo ni a ṣe le ṣe afihan ni iwọn ti faili kan ninu KB pẹlu PowerShell?
(Get-ChildItem -Path .\winsrv.dll).Length /1KB
(Get-ChildItem -Path .\winsrv.dll).Length /1MB
(Get-ChildItem -Path .\winsrv.dll).Length /1GB

Bawo ni a ṣe le wa awọn faili ti o tobi tabi kere ju 1 GB lo pẹlu PowerShell?

Bawo ni a ṣe le ṣe afihan orukọ faili kan lai si itẹsiwaju pẹlu PowerShell?
[System.IO.Path]::GetFileNameWithoutExtension('C:\Windows\system32\calc.exe') # Return calc

Bawo ni a ṣe le ṣe afihan ni apele ti faili pẹlu PowerShell?
[System.IO.Path]::GetExtension('C:\scripts\file.txt') # Return .txt

Bawo ni a ṣe le ni awọn faili ti ikede faili pẹlu PowerShell?

Bawo ni a ṣe le ni awọn haṣi ti faili pẹlu PowerShell?
(Get-FileHash $file).Hash

Bawo ni a ṣe le ni awọn MD5 / SHA1 sayẹwoapao ti faili pẹlu PowerShell?
Get-FileHash $file -Algorithm MD5
Get-FileHash $file -Algorithm SHA1

Bawo ni a ṣe le ṣe afihan awọn faili farasin pẹlu PowerShell?

Bawo ni a ṣe le ṣe ṣayẹwo ti faili ba ni ohun itẹsiwaju pẹlu PowerShell?

Bawo ni a ṣe le ṣeto faili bi “Kiki Kkia” pẹlu PowerShell?
Set-ItemProperty -Path .\file.txt -Name IsReadOnly -Value $true

Bawo ni a ṣe le yi awọn “AkokoKikoKehin” ro si ose fun faili kan pẹlu PowerShell?
Set-ItemProperty -Path .\file.txt -Name LastWriteTime -Value ((Get-Date).AddDays(-7))
If not working, use Nirsoft tool: BulkFileChanger.

Bawo ni a ṣe le ṣẹda titun faili kan pẹlu PowerShell?
New-Item -ItemType File -Path 'C:\scripts\file.txt' -Value 'FirstLine'

Bawo ni a ṣe le ṣe atunkọ orukọ faili pẹlu PowerShell?
Rename-Item -Path 'C:\scripts\file.txt' -NewName 'C:\scripts\powershellguru2.txt'

Bawo ni a ṣe le ṣe ọlọpọpọ / ipele fun atunkọ orukọ ọpọ awọn faili pẹlu PowerShell?
Get-ChildItem -Path C:\scripts\txt | Rename-Item -NewName { $_.Name -replace ' ', '_' }

Bawo ni a ṣe le pa faili rẹ pẹlu PowerShell?
Remove-Item -Path 'C:\scripts\file.txt'

Bawo ni a ṣe le ṣe afihan 10 titun ni ila ti faili pẹlu PowerShell?
Get-Content -Path 'C:\scripts\log.txt' -Tail 10

Bawo ni a ṣe le ṣi ona orisirisi awọn faili ti folda pẹlu PowerShell?
Get-ChildItem -Path 'C:\scripts\Modules' | Unblock-File

Bawo ni a ṣe le yọ ila to o sofo lati inu faili kan pẹlu PowerShell?
(Get-Content -Path file.txt) | Where-Object -FilterScript {$_.Trim() -ne '' } | Set-Content -Path file.txt

Bawo ni a ṣe le ṣayẹwo boya faili kan wa pẹlu PowerShell?

Bawo ni a ṣe le ni awọn faili titun / Atijọ ti a seda ninu folda kan pẹlu PowerShell?

Bawo ni a ṣe le yọ eda ila lati inu faili kan pẹlu PowerShell?

Bawo ni a ṣe le ni awọn eda faili diẹ sii tabi kere ju 1 osù ninu folda kan pẹlu PowerShell?

Bawo ni a ṣe le ni awọn eda faili diẹ sii tabi kere ju 1 odun kan ni folda pẹlu PowerShell?

Bawo ni a ṣe le gbe iye ti a ayípadà si faili kan pẹlu PowerShell?
Set-Content -Path file.txt -Value $variable

Bawo ni a ṣe le ka awọn nọmba ti awọn faili (* .TXT) ni inu folda pẹlu PowerShell?

Bawo ni a ṣe le ṣe awa ri oniruuru inu ọpọ awọn faili pẹlu PowerShell?
Select-String -Path 'C:\*.txt' -Pattern 'Test'

Bawo ni a ṣe le ṣe afihan ila akọkọ / kẹhin ti faili pẹlu PowerShell?

Bawo ni a ṣe le ṣe afihan nọmba laini kan pato ti faili pẹlu PowerShell?

Bawo ni a ṣe le ka awọn nọmba awọn ila ti o wa ninu faili pẹlu PowerShell?

Bawo ni a ṣe le ka awọn nọmba ohun kikọ silẹ ati awọn ọrọ ti o wa ninu faili pẹlu PowerShell?

Bawo ni a ṣe le gba faili lati ori ayelujara pẹlu PowerShell?
Invoke-WebRequest -Uri 'http://www.nirsoft.net/utils/searchmyfiles.zip' -OutFile 'C:\tools\searchmyfiles.zip'

Bawo ni a ṣe le ṣe afihan ni kikun ona faili kan pẹlu PowerShell?
Resolve-Path -Path .\script.ps1 # Return C:\Scripts\script.ps1

Copy

Bawo ni a ṣe le ṣe eda faili lọ si folda kan pẹlu PowerShell?
Copy-Item -Path 'C:\source\file.txt' -Destination 'C:\destination'

Bawo ni a ṣe le ṣe eda faili lati ọpọ awọn folda pẹlu PowerShell?

Bawo ni a ṣe le ṣe eda awọn faili si ọpọ awọn folda pẹlu 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

Bawo ni a ṣe le ri Katalogi apèsè Agbaye ni Alaapo Ipile pẹlu PowerShell?
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().GlobalCatalogs

Bawo ni a ṣe le ri oju’la ni Alaapon Ipile pẹlu PPowerShell?
[System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().Sites

Bawo ni a ṣe le ri ase-isinyi pẹlu àdáṣiṣé PowerShell?
(Get-ADDomainController).HostName

Bawo ni a ṣe le ni gbogbo ako olutona ni a ìkápá pẹlu PowerShell?

Bawo ni a ṣe le wa awọn AD ìfijọ ikuna pẹlu PowerShell?
Get-ADReplicationFailure dc02.domain.com # Windows 8 and 2012

Bawo ni a ṣe le wa awọn okutaiboji s’aiye fun igbo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ri awọn alaye awọn igbo / ako ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ni awọn ona “Ajẹpíparẹ Ibile” eiyan ni Alaapon Ipile pẹlu PowerShell?
(Get-ADDomain).DeletedObjectsContainer

Bawo ni a ṣe le jeki awọn AD atunlo Bin ẹya-ara ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le mu pada ohun AD Akọọlẹ lati atunlo Bin ni Alaapon Ipile pẹlu PowerShell?
Get-ADObject -Filter 'samaccountname -eq "powershellguru"' -IncludeDeletedObjects | Restore-ADObject

Bawo ni a ṣe le wa awọn ipa FSMO pẹlu PowerShell?

Bawo ni a ṣe le se asopọ si pato-ašẹ pẹlu àdáṣiṣé PowerShell?
Get-ADUser -Identity $user -Server 'serverDC01'

Bawo ni a ṣe le ni sopo ni siniyi si olupin pẹlu PowerShell?

Bawo ni a ṣe le ṣe “gpupdate” lori kọmputa kan pẹlu PowerShell?
Invoke-GPUpdate -Computer $computer -Force -RandomDelayInMinutes 0 # Windows 2012

Groups

Bawo ni a ṣe le ṣẹda titun akojọpọ ninu Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le yọ akojopo ninu Alaapon Ipile pẹlu PowerShell?
Remove-ADGroup -Identity 'PowershellGuru'

Bawo ni a ṣe le ṣẹ afikun olumulo si akojopo kan ni Alaapon Ipile pẹlu PowerShell?
Add-ADGroupMember "Powershell Guru" -Members powershellguru

Bawo ni a ṣe le yọ olumulo lati ẹgbẹ kan ni Alaapon Ipile pẹlu PowerShell?
Remove-ADGroupMember 'Powershell Guru' -Members powershellguru

Bawo ni a ṣe le ri awọn ẹgbẹ ti o sofo (pẹlu awọn ti ko si ẹgbẹ) ni Alaapon Ipile pẹlu PowerShell?
Get-ADGroup -Filter * -Properties Members | Where-Object -FilterScript {-not $_.Members}

Bawo ni a ṣe le ka awọn ẹgbẹ ti o sofo (pẹlu awọn ti ko si ẹgbẹ) ni Iroyin Directory pẹlu PowerShell?
(Get-ADGroup -Filter * -Properties Members | Where-Object -FilterScript {-not $_.Members}).Count

Bawo ni a ṣe le ri awọn ọmọ ẹgbẹ ti ẹgbẹ kan ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ri awọn ọmọ ẹgbẹ ti ẹgbẹ kan pẹlu atunwo ọmọ ẹgbẹ ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ka awọn nọmba awọn ọmọ ẹgbẹ ti a ẹgbẹ pẹlu / lai si atunwo omo egbe ni Alaapon Ipile pẹlu PowerShell?

Users

Bawo ni a ṣe le lo waildikadii ninu awọn àlẹmọ ti “Gba-ADUser” ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le gbe olumulo lo si OU miiran ni Alaapon Ipile pẹlu PowerShell?
Move-ADObject -Identity $dn -TargetPath 'OU=myOU,DC=domain,DC=com'

Bawo ni a ṣe le ri gbogbo awọn ọmọ ẹgbẹ ti o ba wa (oni iteeye) fun olumulo a pẹlu PowerShell?
Get-ADGroup -LDAPFilter "(member:1.2.840.113556.1.4.1941:=$($dn))"

Bawo ni a ṣe le ni awọn ọmọ ẹgbẹ (oruko kukuru / gige kuru) fun olumulo a pẹluPowerShell?
(Get-ADUser $user -Properties MemberOf).MemberOf | ForEach-Object -Process {($_ -split ',')[0].Substring(3)} | Sort-Object

Bawo ni a ṣe le se atunko Orukọ (OrukoKikun), (OrukoIfihan), Orukọ Afifun (OrukọAkoko), àti Orúkọ-ìdílé (Orukọigbehin) fun Akoole olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le yi awọn Apejuwe, Ofisi, ati nọmbaTẹlifoonu fun Akoole olumulo ni Alaapon Ipile pẹlu PowerShell?
Set-ADUser $samAccountName -Description 'IT Consultant' -Office 'Building B' -OfficePhone '12345'

Bawo ni a ṣe le ṣeto awọn ipari ọjọ lati “31/12/2015” tabi “Ma” fún akoole olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ṣii akoole olumulo ni Alaapon Ipile pẹlu PowerShell?
Unlock-ADAccount $samAccountName

Bawo ni a ṣe le jeki / mu akoole olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le yọ akoole olumulo ni Alaapon Ipile pẹlu PowerShell?
Remove-ADUser $samAccountName

Bawo ni a ṣe le ṣe atunto oro iwole fun akoole olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ṣe atunto oro iwole fun orisirisi akoole olumulo (olopobobo) ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le wa awọn eni ti o nii faili ninu Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le wa awọn OU (eleto igun) fun olumulo ni Alaapon Ipile pẹlu PowerShell?
[regex]::match("$((Get-ADUser $user -Properties DistinguishedName).DistinguishedName)",'(?=OU=)(.*\n?)').value

Bawo ni a ṣe le ri alaabo akoole olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ri ipari akoole olumulo ni Alaapon Ipile pẹlu PowerShell?
Search-ADAccount -AccountExpired

Bawo ni a ṣe le ri titii pa akoole olumulo ni Alaapon Ipile pẹlu PowerShell?
Search-ADAccount -LockedOut

Bawo ni a ṣe le wa awọn SID fun akoole olumulo ni Alaapon Ipile pẹlu PowerShell?
(Get-ADUser $user -Properties SID).SID.Value

Bawo ni a ṣe le se iyipada orúkọ si SID ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le se iyipada SID si orúkọ olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le pipin ni yato si Orukọ akoole olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le wa awọn ọjọ ti a sẹda / iyipada si akoole olumulo ni Alaapon Ipile pẹlu PowerShell?
Get-ADUser -Identity $user -Properties whenChanged, whenCreated | Format-List -Property whenChanged, whenCreated

Bawo ni a ṣe le se afihan ni iyan ati ohun ini dandan fun awọn kilasi “Olumulo” ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ni awọn ona LDAP fun olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le yi awọn CN (Oruko Kanonika) fun olumulo ni Alaapon Ipile pẹlu PowerShell?
Rename-ADObject $((Get-ADUser $user -Properties DistinguishedName).DistinguishedName) -NewName 'Test Powershell'

Bawo ni a ṣe le ni awọn eleto kuro (OU) obi ti olumulo ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ni awọn eni olumulo (ti o da awọn akọọle) ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ṣe iyipada awọn Pwdti o gbeyin fun olumulo ni Alaapon Ipile pẹlu PowerShell?

Computers

Bawo ni a ṣe le ṣe idanwo awọn ikanni ti o ni aabo laarin awọn kọmputa agbegbe ati ako pẹlu PowerShell?
Test-ComputerSecureChannel

Bawo ni a ṣe le ṣe atunse awọn ikanni ti o ni aabo laarin awọn kọmputa agbegbe ati ako pẹlu PowerShell?
Test-ComputerSecureChannel -Repair

Bawo ni a ṣe le ṣe mu akọọle kọmputa ni Alaapon Ipile pẹlu PowerShell?
Disable-ADAccount $computer

Bawo ni a ṣe le wa awọn kọmputa pẹlu ọna Sistẹm kan pato ni Alaapon Ipile pẹlu PowerShell?

Organizational Unit (OU)

Bawo ni a ṣe le ṣẹda eleto kuro (OU) ni Alaapon Ipile pẹlu PowerShell?
New-ADOrganizationalUnit -Name 'TEST' -Path 'DC=domain,DC=com'

Bawo ni a ṣe le ni eleto kuro (OU) awọn alaye ni Alaapon Ipile pẹlu PowerShell?
Get-ADOrganizationalUnit 'OU=TEST,DC=domain,DC=com' -Properties *

Bawo ni a ṣe le yi awọn apejuwe ti eleto Kuro (OU) ni Alaapon Ipile pẹlu PowerShell?
Set-ADOrganizationalUnit 'OU=TEST,DC=domain,DC=com' -Description 'My description'

Bawo ni a ṣe le ṣẹ jeki / mu eleto Kuro (OU) lati pipare lairotẹlẹ ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le jeki awọn pipare lairotẹlẹ fun gbogbo awọn eleto kuro (OU) ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le yo eleto Kuro (OU) idaabobo kuro lowo pipare lairotẹlẹ ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le se iyipada ti o yato si Oruko ti eleto Kuro (OU) si Oruko Kanonika ni Alaapon Ipile pẹlu PowerShell?

Bawo ni a ṣe le ṣe akojo eleto sipoti o sofo (OUs) pẹlu PowerShell?

Bawo ni a ṣe le ni awọn maneja ti ẹgbẹ pẹlu PowerShell?
(Get-ADGroup $dn -Properties Managedby).Managedby

Up


Regex (Regular Expression)

Bawo ni a ṣe le ṣe agbejade IP adirẹsi V4 (80.80.228.8) pẹlu Regex pẹlu 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

Bawo ni a ṣe le ṣe agbejade adirẹsi MAC (C0-D9-62-39-61-2D) pẹlu oluyasọtọ “-” pẹlu Regex pẹlu 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

Bawo ni a ṣe le ṣe agbejade adirẹsi MAC (C0: D9: 62: 39: 61: 2D) pẹlu oluyasọtọ “:” pẹlu Regex pẹlu 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

Bawo ni a ṣe le ṣe agbejade ọjọ (10/02/2015) pẹlu Regex pẹlu PowerShell?
$example = 'The date is 10/02/2015'
$date = [regex]::match($example,'(\d{2}\/\d{2}\/\d{4})').value

Bawo ni a ṣe le ṣe agbejade URL (www.powershell-guru.com) pẹlu Regex pẹlu PowerShell?
$example = 'The URL is www.powershell-guru.com'
$url = [regex]::match($example,'[a-z]+[:.].*?(?=\s)').value

Bawo ni a ṣe le ṣe agbejade imeeli (user@domain.com) pẹlu Regex pẹlu 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

Bawo ni a ṣe le ṣe agbejade “guru” lati oniruuru apẹẹrẹ pẹlu Regex pẹlu PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=-)(.*\n?)(?=.com)').value

Bawo ni a ṣe le ṣe agbejade “guru.com” lati oniruuru apẹẹrẹ pẹlu Regex pẹlu PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=-)(.*\n?)(?<=.)').value

Bawo ni a ṣe le ṣe agbejade “powershell-guru.com” lati oniruuru apẹẹrẹ pẹlu Regex pẹlu PowerShell?
$example = 'www.powershell-guru.com'
[regex]::match($example,'(?<=www.)(.*\n?)').value

Bawo ni a ṣe le ṣe agbejade “123” lati oniruuru apẹẹrẹ pẹlu Regex pẹlu PowerShell?
$example = 'Powershell123'
[regex]::match($example,'(\d+)').value

Bawo ni a ṣe le ṣe agbejade “$” (dola ami) lati oniruuru apẹẹrẹ pẹlu Regex pẹlu PowerShell?
$example = 'Powershell`$123'
[regex]::match($example,'(\$)').value

Bawo ni a ṣe le ṣe iropo ohun kikọ silẹ (* @ example.com) pẹlu miiran (* .fr) ni oniruuru pẹlu Regex pẹlu PowerShell?
$example = 'www.powershell-guru.com'
[regex]::Replace($example, '.com','.fr')

Bawo ni a ṣe le sa fun oniruuru pẹlu Regex pẹlu PowerShell?
[regex]::Escape('\\server\share')

Up


Memory

Bawo ni a ṣe le ṣe ipa pelu gbigba fun iranti nipasẹ awọn idoti-odè pẹlu PowerShell?
[System.GC]::Collect()
[System.GC]::WaitForPendingFinalizers()

Bawo ni a ṣe le ni awọn Ramu iwọn ti kọmputa pẹlu PowerShell?

Up


Date

Bawo ni a ṣe le ni awọn ọjọ isinyi pẹlu PowerShell?
Get-Date
[Datetime]::Now

Bawo ni a ṣe le ṣe afihan si awọn ọjọ ni iyatọ si ọna kika pẹlu PowerShell?

Bawo ni a ṣe le ṣe iyipada ọjọ (OjoAkoko) si a ọjọ (ni okun oniruuru) pẹlu PowerShell?
$datetimeToString = '{0:dd/MM/yy}' -f (Get-Date 30/01/2015)
$datetimeToString = (Get-Date 31/01/2015).ToShortDateString()

Bawo ni a ṣe le ṣe iyipada ọjọ kan (ni okun oniruuru) si a ọjọ (Ojoakoko) pẹlu PowerShell?
$stringToDatetime = [Datetime]::ParseExact('30/01/2015', 'dd/MM/yyyy', $null)

Bawo ni a ṣe le ṣe iṣiro awọn iyato (nọmba ti Ọjọ, Wakati, Iṣẹju, tabi Aaya) laarin meji ọjọ pẹlu 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

Bawo ni a ṣe le ṣe afiwe meji ọjọ pẹlu 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

Bawo ni a ṣe le ṣe eto ọjọ bi “Ojoakoko” pẹlu PowerShell?
$arrayDate | Sort-Object -Property {$_ -as [Datetime]}

Bawo ni a ṣe le bẹrẹ ati daa duro ago iseju aaya pẹlu PowerShell?
$chrono = [Diagnostics.Stopwatch]::StartNew()
$chrono.Stop()
$chrono

Bawo ni a ṣe le ni awọn ọjọ ti o wa ninu ọsẹ kan pẹlu PowerShell?
(Get-Date).DayOfWeek #Sunday

Bawo ni a ṣe le ri ojo ana ká pẹlu PowerShell?
(Get-Date).AddDays(-1)

Bawo ni a ṣe le ri awọn nọmba ti ọjọ inu osu kan (ni February 2015) pẹlu PowerShell?
[DateTime]::DaysInMonth(2015, 2)

Bawo ni a ṣe le mọ odun ti o le pẹlu PowerShell?
[DateTime]::IsLeapYear(2015)

Bawo ni a ṣe le ṣe akojo akoko ita pẹlu PowerShell?
[System.TimeZoneInfo]::GetSystemTimeZones()

Up


Networking

Bawo ni a ṣe le ṣe alákọbẹrẹ (si ASCII kika) ati ki o si iyipada URL pẹlu PowerShell?

Kini awon ti o wa idakeji ti nẹtiwọki abinibi ase pẹlu PowerShell?

Bawo ni a ṣe le ni IP adirẹsi pẹlu PowerShell?
Get-NetIPAddress # Windows 8.1 & Windows 2012
Get-NetIPConfiguration # Windows 8.1 & Windows 2012

Bawo ni a ṣe le mu IP adiresi V6 (IPv6) pẹlu PowerShell?

Bawo ni a ṣe le mo ooto IP adirẹsi V4 (IPv4) pẹlu PowerShell?
if([ipaddress]'10.0.0.1'){'validated'}

Bawo ni a ṣe le wa awọn IP adiresi ita pẹlu PowerShell?

Bawo ni a ṣe le ṣei wa awọn Orukoigbalejo lati ẹya IP adiresi pẹlu PowerShell?
([System.Net.Dns]::GetHostEntry($IP)).Hostname

Bawo ni a ṣe le wa awọn IP adiresi lati ibi Orukoigbalejo pẹlu PowerShell?
([System.Net.Dns]::GetHostAddresses($computer)).IPAddressToString

Bawo ni a ṣe le wa awọn FQDN lati ibi Orukoigbalejo pẹlu PowerShell?
[System.Net.Dns]::GetHostByName($computer).HostName

Bawo ni a ṣe le ri nẹtiwọki iṣeto ni (Ip, Subnet, Getiwe, ati DNS) pẹlu PowerShell?

Bawo ni a ṣe le wa awọn adirẹsi MAC pẹlu PowerShell?
Get-CimInstance win32_networkadapterconfiguration | Select-Object -Property Description, Macaddress
Get-WmiObject -Class win32_networkadapterconfiguration | Select-Object -Property Description, Macaddress

Bawo ni a ṣe le Pingi kọmputa pẹlu PowerShell?

Bawo ni a ṣe le ṣe ayẹwo isopo kọmputa si ayelujara pẹlu PowerShell?

Bawo ni a ṣe le ṣe “Tani” jade fun aaye ayelujara pẹlu PowerShell?
$whois = New-WebServiceProxy 'http://www.webservicex.net/whois.asmx?WSDL'
$whois.GetWhoIs('powershell-guru.com')

Bawo ni a ṣe le gba alaye ti gbangba IP (Geolocation) pẹlu PowerShell?

Bawo ni a ṣe le ṣe ayẹwo ti ibudo ba wa ni sisi/ pipade pẹlu PowerShell?
New-Object -TypeName Net.Sockets.TcpClient -ArgumentList $computer, 135

Bawo ni a ṣe le ṣe “tracert” pẹlu PowerShell?
Test-NetConnection www.google.com -TraceRoute

Bawo ni a ṣe le ṣe atunse si nẹtiwọki asopọ profaili pẹlu PowerShell?
Get-NetAdapter | Format-Table -Property Name, InterfaceDescription, ifIndex -AutoSize # Windows 8.1
Set-NetConnectionProfile -InterfaceIndex 6 -NetworkCategory Private

Bawo ni a ṣe le fi awọn ibudo isopọ TCP pẹlu PowerShell?
netstat.exe -ano
Get-NetTCPConnection #Windows 8 and 2012

Bawo ni a ṣe le fi si kekere gun URL sinu aami URL pẹlu PowerShell?
$url = 'www.powershell-guru.com'
$tiny = Invoke-RestMethod -Uri "http://tinyurl.com/api-create.php?url=$url"

Bawo ni a ṣe le gba eto aṣoju pẹlu PowerShell?
Get-ItemProperty -Path HKCU:"Software\Microsoft\Windows\CurrentVersion\Internet Settings"

DNS

Bawo ni a ṣe le ṣe ayẹwo awọn DNS kaṣe lori kọmputa agbegbe pẹlu PowerShell?
ipconfig.exe /displaydns
Get-DnsClientCache #Windows 8 and 2012

Bawo ni a ṣe le ko DNS kaṣe lori kọmputa Agbegbe pẹlu PowerShell?
ipconfig.exe /flushdns
Start-Process -FilePath ipconfig -ArgumentList /flushdns -WindowStyle Hidden
Clear-DnsClientCache #Windows 8 and 2012

Bawo ni a ṣe le ko DNS kaṣe lori kọmputa latọna jijin pẹlu PowerShell?
Invoke-Command -ScriptBlock {Clear-DnsClientCache} -ComputerName computer01, computer02

Bawo ni a ṣe le ka awọn faili pẹlu PowerShell?
Get-Content -Path 'C:\Windows\system32\drivers\etc\hosts'

Up


Password

Bawo ni a ṣe le ri ọrọigbaniwọle pẹlu PowerShell?
[Reflection.Assembly]::LoadWithPartialName('System.Web')
[System.Web.Security.Membership]::GeneratePassword(30,2)

Bawo ni a ṣe le yi awọn ọrọigbaniwọle Agbegbe fun IT lori ọnajijin olupin pẹlu PowerShell?
$admin = [ADSI]('WinNT://server01/administrator,user')
$admin.SetPassword($password)
$admin.SetInfo()

Bawo ni a ṣe le ri awọn ọrọigbaniwọle ipari ojo ti akoole ni Alaapon Ipile pẹlu PowerShell?

Up


Printers

Bawo ni a ṣe le ṣe akojo gbogbo awọn ẹrọ atẹwe fun safa kan pato pẹlu PowerShell?
Get-WmiObject -Query 'Select * From Win32_Printer' -ComputerName $computer

Bawo ni a ṣe le ṣe akojo gbogbo awọn ibudo kan pato fun olupin pẹlu PowerShell?
Get-WmiObject -Class Win32_TCPIPPrinterPort -Namespace 'root\CIMV2' -ComputerName $computer

Bawo ni a ṣe le yi awọn ọrọìwòye / ipo ti a itẹwe pẹlu PowerShell?

Bawo ni a ṣe le mú (fagile gbogbo ise) si itẹwe pẹlu PowerShell?
$printer = Get-WmiObject -Class win32_printer -Filter "Name='HP Deskjet 2540 series'"
$printer.CancelAllJobs()

Bawo ni a ṣe le se igbeyewo atẹ sita fun itẹwe pẹlu PowerShell?
$printer = Get-WmiObject -Class win32_printer -Filter "Name='HP Deskjet 2540 series'"
$printer.PrintTestPage()

Bawo ni a ṣe le ri itewe lori ila fun ẹrọ atẹwe pẹlu PowerShell?

Up


Regedit

Read

Bawo ni a ṣe le ṣe akojo àkọsílẹ afara pẹlu PowerShell?
Get-ChildItem -Path Registry::

Bawo ni a ṣe le ni àkọsílẹ iye ati iye orisi pẹlu PowerShell?

Bawo ni a ṣe le ṣe akojo àkọsílẹ bọtini subkeys pẹlu PowerShell?

Bawo ni a ṣe le ṣe akojo àkọsílẹ bọtini subkeys ni a recursive ọna pẹlu PowerShell?
Get-ChildItem -Path 'HKLM:\SYSTEM' -Recurse -ErrorAction SilentlyContinue

Bawo ni a ṣe le wa subkeys pẹlu oruko kan pato pẹlu PowerShell?
Get-ChildItem -Path 'HKLM:\SOFTWARE' -Include *Plugin* -Recurse -ErrorAction SilentlyContinue

Bawo ni a ṣe le ṣe ipada oruko nikan ninu awọn àkọsílẹ subkeys pẹlu PowerShell?
(Get-ChildItem -Path 'HKLM:\SYSTEM').Name # Return HKEY_LOCAL_MACHINE\SYSTEM\ControlSet
Get-ChildItem -Path 'HKLM:\SYSTEM' -Name # Return ControlSet

Bawo ni a ṣe le ṣe akojo iye àkọsílẹ pẹlu PowerShell?
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion'

Bawo ni a ṣe le ka àkọsílẹ pato iye pẹlu PowerShell?
(Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion').ProductName

Bawo ni a ṣe le ka ni pato àkọsílẹ iye lori latọna kọmputa pẹlu PowerShell?

Write

Bawo ni a ṣe le ṣe ẹda àkọsílẹ titun bọtini pẹlu PowerShell?
New-Item -Path 'HKCU:\Software\MyApplication'

Bawo ni a ṣe le ṣe ẹda iye àkọsílẹ pẹlu PowerShell?
New-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version' -Value '1.0'

Bawo ni a ṣe le yi iye àkọsílẹ to wa tẹlẹ pẹlu PowerShell?
Set-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version' -Value '2.0'

Delete

Bawo ni a ṣe le pa iye àkọsílẹ re pẹlu PowerShell?
Remove-ItemProperty -Path 'HKCU:\Software\MyApplication' -Name 'Version'

Bawo ni a ṣe le pa àkọsílẹ bọtini re pẹlu PowerShell?
Remove-Item -Path 'HKCU:\Software\MyApplication' -Force

Test

Bawo ni a ṣe le ṣe idanwo ti àkọsílẹ bọtini ba wa pẹlu PowerShell?
Test-Path -Path 'HKCU:\Software\MyApplication'

Bawo ni a ṣe le ṣe idanwo ti iye àkọsílẹ ba wa pẹlu PowerShell?
(Get-Item -Path 'HKCU:\Software\MyApplication').GetValueNames() -contains 'Version'

Up


Strings

Bawo ni a ṣe le yọ aaye-funfun ohun kikọ lati ibẹrẹ ti oniruuru pẹlu PowerShell?
$string = ' PowershellGuru'
$string = $string.TrimStart()

Bawo ni a ṣe le yọ aaye-funfun ohun kikọ lati opin oniruuru pẹlu PowerShell?
$string = 'PowershellGuru '
$string = $string.TrimEnd()

Bawo ni a ṣe le yọ aaye-funfun ohun kikọ (ti o bẹrẹ ati opin si) ti oniruuru pẹlu PowerShell?
$string = ' PowershellGuru '
$string = $string.Trim()

Bawo ni a ṣe le ṣe iyipada oniruuru si leta Nla pẹlu PowerShell?
$string = 'powershellguru'
$string = $string.ToUpper()

Bawo ni a ṣe le ṣe iyipada oniruuru lati kekere ti irú pẹlu PowerShell?
$string = 'POWERSHELLGURU'
$string = $string.ToLower()

Bawo ni a ṣe le yan awọn substring “PowerShell” ti awọn okun oniruuru “PowerShellGuru” pẹlu PowerShell?
$string.Substring(0,10)

Bawo ni a ṣe le yan awọn substring “Ojogbon” ti awọn okun oniruuru “PowerShellGuru” pẹlu PowerShell?
$string.Substring(10)

Bawo ni a ṣe le yan awọn nọmba “123” ti “PowerShell123Guru” pẹlu PowerShell?
$string = 'Powershell123Guru'
[regex]::match($string,'(\d+)').value

Bawo ni a ṣe le gba awọn odo-orisun Ìwé ti “Guru” ti awọn okun oniruuru “OjogbonPowerShell” pẹlu PowerShell?
$string.IndexOf('Guru') # 10

Bawo ni a ṣe le ṣe ayẹwo boya oniruuru jẹ asan tabi sofo pẹlu PowerShell?
$string = $null
$string = ''
[string]::IsNullOrEmpty($string)

Bawo ni a ṣe le ṣe ayẹwo boya oniruuru jẹ asan, sofo, tabi oriširiši nikan aaye-funfun ohun kikọ pẹlu PowerShell?
$string = $null
$string = ''
$string = ' '
[string]::IsNullOrWhiteSpace($string)

Bawo ni a ṣe le ṣe ayẹwo boya oniruuru ni lẹta kan pato pẹlu PowerShell?
$string = 'PowershellGuru'
$string.Contains('s')
[regex]::match($string,'s').Success

Bawo ni a ṣe le pada si awọn ipari ti oniruuru pẹlu PowerShell?
$string.Length

Bawo ni a ṣe le ṣe concatenate meji pelu awọn gbolohun ọrọ pẹlu PowerShell?

Bawo ni lati baramu fun ọkan tabi pupọ biraketi “[]” ni a oniruuru pẹlu PowerShell?
$string = '[PowershellGuru]'
$string -match '\[' # Only 1
$string -match '\[(.*)\]' # Several

Bawo ni a ṣe le ibaramu fun ọkan tabi pupọ akomo “()” ni oniruuru pẹlu PowerShell?
$string = '(PowershellGuru)'
$string -match '\(' # Only 1
$string -match '\((.*)\)' # Several

Bawo ni a ṣe le ṣe ibaramu fun ọkan tabi pupọ iṣupọ biraketi “{}” ni oniruuru pẹlu PowerShell?
$string = '{PowershellGuru}'
$string -match '\{' # Only 1
$string -match '\{(.*)\}' # Several

Bawo ni a ṣe le ṣe ibaramu fun ọkan tabi pupọ igun biraketi “<>” ni oniruuru pẹlu PowerShell?
$string = ''
$string -match '\<' # Only 1
$string -match "\<(.*)\>" # Several

Bawo ni a ṣe le ṣe ibaramu eyikeyi leta isale awọn lẹta (ABC) ni oniruuru pẹlu PowerShell?
$string = 'POWERSHELLGURU'
$string -cmatch "^[a-z]*$" #False

Bawo ni a ṣe le ṣe ibaramu eyikeyi leta oke (ABC) ni oniruuru pẹlu PowerShell?
$string = 'powershellguru'
$string -cmatch "^[A-Z]*$" #False

Bawo ni a ṣe le ṣe ibaramu “[p” (p kekere) ni oniruuru pẹlu PowerShell?
$string = '[powershellGuru]'
$string -cmatch '\[[a-z]\w+' #True

Bawo ni a ṣe le ṣe ibaramu “[P” (P oke nla) ni oniruuru pẹlu PowerShell?
$string = '[PowershellGuru]'
$string -cmatch '\[[A-Z]\w+' #True

Bawo ni a ṣe le ṣe iropo ila pẹlu ila miiran pẹlu PowerShell?
$a = 'Line A'
$b = 'Line B'
$a = $a -replace $a, $b

Bawo ni a ṣe le ṣe iyipada kan pipin isẹ si ni okun oniruuru (ogorun) pẹlu PowerShell?
(1/2).ToString('P')

Bawo ni a ṣe le to awọn gbolohun ọrọ ti o ni awọn nọmba pẹlu PowerShell?

Bawo ni a ṣe le yan awọn ọrọ ti o kẹhin gbolohun pẹlu PowerShell?
$sentence = 'My name is Test Powershell'
$sentence.Split(' ')[-1] # Returns Powershell

Bawo ni a ṣe le gba awọn ọrọ gbolohun ti o tobi pẹlu PowerShell?
$sentence = 'My name is Test Powershell'
$sentence.Split(' ') | Sort-Object -Property Length | Select-Object -Last 1 # Returns Powershell

Bawo ni a ṣe le ka awọn nọmba ti akoko kan ni oniruuru bayi laarin gbolohun pẹlu PowerShell?
$sentence = 'test test test Powershell'
[regex]::Matches($sentence, 'test').Count # Returns 3

Bawo ni a ṣe le da kọọkan ohun kikọ ni oniruuru si ohun kikọ silẹ kan orun pẹlu PowerShell?

Bawo ni a ṣe le ṣe iyipada awọn lẹta akọkọ lati uppercase ti a oniruuru pẹlu PowerShell?

Bawo ni a ṣe le ṣe paadi (sosi tabi sọtun) oniruuru pẹlu PowerShell?

Bawo ni a ṣe le ṣe alákọbẹrẹ dé ki o si iyipada si oniruuru si Base64 pẹlu PowerShell?

Bawo ni a ṣe le ṣe iyipada nomba kan (si ati lati) alakomeji pẹlu PowerShell?

Bawo ni a ṣe le ṣe ipada nikan ni kẹhin obi folda kan ni ona pẹlu PowerShell?

Bawo ni a ṣe le ṣe ipada nikan ni ikẹhin ohun kan ni a ona pẹlu PowerShell?

Up


Math

Bawo ni a ṣe le ṣe akojo awọn ọna ti awọn Sistem.Math kilasi pẹlu PowerShell?
[System.Math] | Get-Member -Static -MemberType Method

Bawo ni a ṣe le ṣe ipada iye ifise pelu PowerShell?
[Math]::Abs(-12) #Returns 12
[Math]::Abs(-12.5) # Returns 12.5

Bawo ni a ṣe le pada si awọn igun ti sine ni pàtó kan nọmba pẹlu PowerShell?
[Math]::ASin(1) #Returns 1,5707963267949

Bawo ni a ṣe le pada si iye aja pẹlu PowerShell?
[Math]::Ceiling(1.4) #Returns 2
[Math]::Ceiling(1.9) #Returns 2

Bawo ni a ṣe le pada si awọn iye pakà pẹlu PowerShell?
[Math]::Floor(1.4) #Returns 1
[Math]::Floor(1.9) #Returns 1

Bawo ni a ṣe le pada si awọn adayeba (base e) logarithm ti pàtó kan nọmba pẹlu PowerShell?
[Math]::Log(4) #Returns 1,38629436111989

Bawo ni a ṣe le pada si base 10 logarithm ti pàtó kan nọmba pẹlu PowerShell?
[Math]::Log10(4) #Returns 0,602059991327962

Bawo ni a ṣe le pada si eyi ti o pọju ti awọn iye meji pẹlu PowerShell?
[Math]::Max(2,4) #Returns 4
[Math]::Max(-2,-4) #Returns -2

Bawo ni a ṣe le pada si eyi ti o kere ni iye meji pẹlu PowerShell?
[Math]::Min(2,4) #Returns 2
[Math]::Max(-2,-4) #Returns -4

Bawo ni a ṣe le pada si nọmba okan pàtó ni agbara pẹlu PowerShell?
[Math]::Pow(2,4) #Returns 16

Bawo ni a ṣe le pada si nomba eleemewa iye si eyi ti o ji isunmọ iye pẹlu PowerShell?
[Math]::Round(3.111,2) #Returns 3,11
[Math]::Round(3.999,2) #Returns 4

Bawo ni a ṣe le pada ni je apa ti a pàtó nọmba eleemewa pẹlu PowerShell?
[Math]::Truncate(3.111) #Returns 3
[Math]::Truncate(3.999) #Returns 3

Bawo ni a ṣe le pada si square root ti nọmba kan pato pẹlu PowerShell?
[Math]::Sqrt(16) #Returns 4

Bawo ni a ṣe le pada si awọn PI ibakan pẹlu PowerShell?
[Math]::Pi #Returns 3,14159265358979

Bawo ni a ṣe le pada si awọn adayeba logarithmic base (ibakan e) PowerShell?
[Math]::E #Returns 2,71828182845905

Bawo ni a ṣe le ṣe ayẹwo ti o ba jẹ nọmba kan paapa tabi odd pẹlu PowerShell?
[bool]($number%2)

Up


Hashtables

Bawo ni a ṣe le ṣẹda iṣofo tabilihaṣi pẹlu PowerShell?
$hashtable = @{}
$hashtable = New-Object -TypeName System.Collections.Hashtable

Bawo ni a ṣe le ṣẹda tabilihaṣi pẹlu awọn ohun kan pẹlu PowerShell?

Bawo ni a ṣe le ṣẹda tabilihaṣi ti yio to lẹsẹsẹ nipasẹ bọtini / orukọ (paṣẹ iwe-itumọ) pẹlu awọn ohun pẹlu PowerShell?

Bawo ni a ṣe le fi awọn ohun kan (bọtini-iye bata) si tabilihaṣi pẹlu PowerShell?
$hashtable.Add('Key3', 'Value3')

Bawo ni a ṣe le ni iye kan-kan pato ti yio je ti tabilihaṣi pẹlu PowerShell?
$hashtable.Key1
$hashtable.Get_Item('Key1')

Bawo ni a ṣe le ni awọn ohun iye kekere ti tabilihaṣi pẹlu PowerShell?

Bawo ni a ṣe le ni awọn ohun pupọ ni iye ti tabilihaṣi pẹlu PowerShell?

Bawo ni a ṣe le ṣẹ iyipada ohun kan ni ti tabilihaṣi pẹlu PowerShell?
$hashtable.Set_Item('Key1', 'Value1Updated')

Bawo ni a ṣe le yọ awọn ohun kan kuro ni tabilihaṣi pẹlu PowerShell?
$hashtable.Remove('Key1')

Bawo ni a ṣe le ko awon nkan kuro ni tabilihaṣi pẹlu PowerShell?
$hashtable.Clear()

Bawo ni a ṣe le ṣayẹwo niwaju awon nkan pato bọtini /ni iye ti tabilihaṣi pẹlu PowerShell?
$hashtable.ContainsKey('Key3')
$hashtable.ContainsValue('Value3')

Bawo ni a ṣe le to nipase bọtini / ni iye ti tabilihaṣi pẹlu PowerShell?
$hashtable.GetEnumerator() | Sort-Object -Property Name
$hashtable.GetEnumerator() | Sort-Object -Property Value -Descending

Up


Arrays

Bawo ni a ṣe le ṣẹ ẹda ohun ti o ṣofo pẹlu PowerShell?
$array = @()
$array = [System.Collections.ArrayList]@()

Bawo ni a ṣe le ṣẹ ẹda awọn ohun kan pẹlu PowerShell?
$array = @('A', 'B', 'C')
$array = 'A', 'B', 'C'
$array = 'a,b,c'.Split(',')
$array = .{$args} a b c
$array = echo a b c

Bawo ni a ṣe le fi awọn ohun kan lọ si ipinnu pẹlu PowerShell?
$array += 'D'
[void]$array.Add('D')

Bawo ni a ṣe le yi ohun kan ninu ohun itẹgun pẹlu PowerShell?
$array[0] = 'Z' # 1st item[0]

Bawo ni a ṣe le ṣ’ayẹwo awọn iwọn pẹlu PowerShell?
$array = 'A', 'B', 'C'
$array.Length # Returns 3

Bawo ni a ṣe le ni ohun kan / orisirisi / ohun gbogbo ninu itẹgun pẹlu PowerShell?
$array = @('A', 'B', 'C')
$array[0] # One item (A)
$array[0] + $array[2] # Several items (A,C)
$array # All items (A,B,C)

Bawo ni a ṣe le yọ awọn ohun ti o sofo ninu ẹya itẹgun pẹlu PowerShell?
$array = @('A', 'B', 'C', '')
$array = $array.Split('',[System.StringSplitOptions]::RemoveEmptyEntries) | Sort-Object # A,B,C

Bawo ni a ṣe le ṣ’ayẹwo boya awon ohun kan wa ninu ẹya itẹgun pẹlu PowerShell?
$array = @('A', 'B', 'C')
'A' | ForEach-Object -Process {$array.Contains($_)} # Returns True
'D' | ForEach-Object -Process {$array.Contains($_)} # Returns False

Bawo ni a ṣe le wa awọn Ìwé nọmba ti ohun kan ninu itẹgun pẹlu PowerShell?
$array = @('A', 'B', 'C')
[array]::IndexOf($array,'A') # Returns 0

Bawo ni a ṣe le se idapada awọn aṣẹ ti ohun kan ninu itẹgun pẹlu PowerShell?
$array = @('A', 'B', 'C')
[array]::Reverse($array) # C,B,A

Bawo ni a ṣe le ri awon ohun kan lati itẹgun pẹlu PowerShell?
$array | Get-Random

Bawo ni a ṣe le to ohun ni sise n tele sòke / sọkalẹ pẹlu PowerShell?
$array = @('A', 'B', 'C')
$array | Sort-Object # A,B,C
$array | Sort-Object -Descending # C,B,A

Bawo ni a ṣe le ka awọn nọmba awọn ohun kan ninu itẹgun pẹlu PowerShell?
$array.Count

Bawo ni a ṣe le fi awọn ohun itegun sinu ohun miran pẹlu PowerShell?
$array1 = 'A', 'B', 'C'
$array2 = 'D', 'E', 'F'
$array3 = $array1 + $array2 # A,B,C,D,E,F

Bawo ni a ṣe le wa eda lati ẹya itegun pẹlu PowerShell?
$array = 'A', 'B', 'C', 'C'
($array | Group-Object | Where-Object -FilterScript {$_.Count -gt 1}).Values # Returns C

Bawo ni a ṣe le yọ eda lati ẹya itegun pẹlu PowerShell?
$array = 'A', 'B', 'C', 'C'
$array = $array | Select-Object -Unique
$array # Returns A,B,C

Bawo ni a ṣe le ṣẹ ẹda ohun itegun pẹlu awọn ohun ti o bere pẹlu ìtọka ìpele (“user01”, “user02”, … “user10”) pẹlu PowerShell?
$array = 1..10 | ForEach-Object -Process { "user$_" }

Up


ACL

Bawo ni a ṣe le ṣẹ akojo ACL ti ẹya AD olumulo pẹlu PowerShell?
(Get-Acl -Path "AD:\$dn").Access

Bawo ni a ṣe le ṣẹ akojo ACL ti folda pẹlu PowerShell?
(Get-Acl -Path C:\scripts).Access

Bawo ni a ṣe le ṣẹ akojo kan pato ACL aiye titẹ sii (awọn olumulo tabi awọn ẹgbẹ) ti AD olumulo pẹlu PowerShell?

Up


Variables

Kini iru awon data ti o wọpọ julọ pẹlu PowerShell?

Bawo ni a ṣe le ri eyi ti o kere ati eyi ti o pọju niye fun iru awọn oniyipada pẹlu PowerShell?

Bawo ni a ṣe le ṣẹ idanwo iru awọn data pẹlu PowerShell?

Bawo ni a ṣe le ṣẹ ẹda kan Nibi okun oniruuru ayípadà pẹlu PowerShell?