Abalawuli benkqubo banesixhobo esinomdla esingasoloko sisetyenziswa kakuhle: Windows PowerShell. Enkosi kuyo, kuyenzeka ukuba wenze imisebenzi emininzi ngokuzenzekelayo okanye ubuncinci uyenze ngendlela enocwangco nelawulwayo.
Lo mbono wazalwa ngo-2003 phantsi kwegama le-MONAD kwaye kwiminyaka emithathu kamva yaziswa kuluntu phantsi kwegama layo langoku lokubonisa Vista Windows. Emva koko, ifakiwe kwakhona kwiinguqulelo zeWindows 7, Windows 8 kunye neWindows 10. Ukongeza, kunokwenzeka kwakhona ukufaka i-Powershell kwiinkqubo zeLinux kunye neMacOS.
Ngexesha elifutshane kakhulu kwaziwa ukuba umbono wokwazisa iWindows Powershell ube yimpumelelo. Ukusuka kuMicrosoft kwaqinisekiswa ukuba ukuqonda esi sixhobo kuya kuba esona buchule sibalulekileyo sifunwa ngumphathi kwixesha elizayo. Kuloo nto yodwa kufanelekile ukunikela ingqalelo.
I-Windows Powershell: isixhobo esinamandla
IWindows PowerShell sisixhobo esasungulwa ngombono oncomekayo wokwenza ubomi bube lula kubadwelisi benkqubo. Kwi-computing, inikwe igama elithi iqokobhe kujongano lwelayini yomyalelo emisebenzi yayo ingundoqo ikukuqokelela ulwazi nokwenza iinkqubo. Ngapha koko, iWindows PowerShell liqokobhe lomyalelo langoku elenziwe ngokuthatha ezona mpawu zibalaseleyo zamanye amaqokobhe.
Eli qokobhe linamandla elivela kuMicrosoft ulwimi lweskripthi, nto leyo eyenza kube lula ngakumbi ukwenza le misebenzi. Kwelinye icala, isebenzisa ulwimi lwenkqubo oluphuhliswe kwi-Microsoft .NET Framework, enye yezona zisetyenziswa kakhulu kwihlabathi.
Kukho malunga nezixhobo ze-130 zomgca womyalelo kwi-PowerShell. Enkosi kubo, ubukhali obukhulu bufezekiswa xa kusenziwa eyona misebenzi yahlukeneyo, kwinkqubo yasekhaya nakwindawo ekude.
Yeyantoni iWindows PowerShell?
Alithandabuzeki elokuba esi sesinye sezona zisombululo zibalaseleyo eziyilwe nguMicrosoft kumaxesha akutshanje. I-PowerShell inokuba luncedo olukhulu kubasebenzisi abajonge ukufikelela kwinqanaba elithile le-automation yemisebenzi yabo, ukusuka kukhangelo ukuya ekuthumeleni ulwazi kumazwe angaphandle kwiikhompyuter ezinenethiwekhi.
Zonke izenzo zenziwa nge indibaniselwano yomyalelo (vumela o cmdlets) kunye ne umbhalo. Ezi zezinye zezixhobo zayo:
Ukufikeleleka kolwazi
I-PowerShell isivumela ukuba sifikelele kwisixokelelwano sefayile yekhompyuter, side sifikelele kweyona datha ingafikelelekiyo kunye nolwazi, olufana nobhaliso lweWindows. Le "mendo" ihlala ivuliwe ngokusetyenziswa kwesiseko .NET Framework. Kwakhona, lonke ulwazi lukhona iyafumaneka kumsebenzisi ngelayini yomyalelo omnye. Ulawulo olupheleleyo kunye nokubonakala.
Ukukwazi ukuzenzela
Mhlawumbi eyona nto inomdla kakhulu yePowerShell, ebandakanya ezininzi cmdlets esisiseko, imiyalelo elula yokusebenza eyakhelwe kwiqokobhe. Ezinye zinokongezwa kwezi cmdlets yeyakho. Umyalelo ngamnye kule unokusetyenziswa ngawodwa okanye kudityaniswe ukwenza imisebenzi entsokothileyo., ukufikelela kwinqanaba elimangalisayo lokuzisebenzela.
Okunxulumene noku kukukwazi ukusabalala enikezelwa yiWindows Powershell. Ngokusebenzisa i-cmdlet script enye, umsebenzi wohlobo lwesiqhelo (ofana nokuhlaziya isixokelelwano sokusebenza) unokuphunyezwa ukuze wenziwe kuthungelwano lweekhompyuter ngamaxesha athile.
Unxibelelwano olukude
Okunye okuqaphelekayo kukukwazi kwePowerShell ukuba qhagamshela ukude kwenye inkqubo. Umzekelo unokuba ngumlawuli obefuna ukuqhagamshela kumncedisi obekwe kwindawo eyahlukileyo ebonakalayo apho angenza khona imiyalelo ngendlela efanayo nokuba usebenza ngokuthe ngqo.
Eminye imiyalelo yePowerShell eluncedo
Ukuqala ukusebenza ngesixhobo sePowerShell, kufuneka ufikelele kwi-Run function efakwe kwiWindows ngokulandela la manyathelo:
- Kwangaxeshanye cofa amaqhosha Windows + R.
- Kwibhokisi ethi Run evula ngokulandelayo, sichwetheza "PowerShell" kwaye ucofe ku "Ukwamkela".
Nalu uluhlu lwee-cmdlets eziluncedo ezinokuthi zisetyenziswe kwi-PowerShell, nangona ziyisampuli encinci yazo zonke:
Fumana-Uncedo
Enye yezinto zokuqala ukufunda ukuphatha iPowerShell kakuhle, kuba lo myalelo uya kusinika onke amaxwebhu esifuna ukuwazi malunga nemisebenzi, cmdlets, imiyalelo kunye nezikripti. Umzekelo, ukufumana ulwazi oluthe kratya malunga ne-Get-Service cmdlet, chwetheza "Fumana-Uncedo Fumana-iNkonzo".
Khuphela into
Usebenzisa lo myalelo unokukopa iziqulathi zeefayili okanye iifayile. Ikwakuvumela ukuba uzikhuphele kwaye uzithiye ngokutsha.
Fumana iNkonzo
Iqhele uku Yazi ukuba zeziphi iinkonzo ezifakwe kwisixokelelwanoa, zombini ezo zibalekayo kunye nezo sele zimisiwe.
I-Invoke-Command
Isetyenziselwa ukuphumeza iscript okanye umyalelo wePowerShell kwikhompyuter enye okanye ngaphezulu. Isetyenziswa ngokubhala i-Invoke-Command ecaleni kwescript esinendawo yaso ngqo.
Susa-Into
Umyalelo wokucima nayiphi na into efana neefolda, iifayile kunye nemisebenzi. Ivumela ukucinywa okukhethiweyo okusekwe kuthotho lweeparamitha ezithile.
Fumana iNkqubo
Ukusebenzisa i-PowerShell unokufumanisa ukuba zeziphi iinkqubo ezisebenzayo (ukusebenza kwayo kuyafana nomyalelo wokufumana iNkonzo).
Isiphelo
Ithathwa nganye nganye, yonke le miyalelo isenokungabonakali iluncedo kakhulu. Ubunako bayo bokwenyani bubonakaliswa xa umyalelo udityaniswe nezinye iiparamitha. Kulapho bafumanisa khona amandla abo apheleleyo.
Okokugqibela, ukuba sifuna ukwazi zonke iicmdlets zePowerShell ezikhoyo, konke ekufuneka sikwenze kukuphumeza umyalelo. "Bonisa-Umyalelo", eya kuvula ifestile ebonisa uluhlu olude lwayo yonke imiyalelo.
Isenzi esininzi kwaye kunzima kakhulu ukwetyisa. Andazi ukuba yenzelwe ntoni
Ndiyihlaziya njani?