PowerShell 7 Liiska Tilmaamaha Cusub
Nooca xiga ee weyn ee PowerShell wuu baxay, wuxuuna keenayaa xoogaa isbeddelo ah oo la taaban karo. Nooca toddobaad waxa ku jira astaamo ay ka mid yihiin fulinta is barbar socda, soo dejinta qaybo meel fog laga fuliyo, hawl-wadeenno cusub, iyo in ka badan. Maqaalkan, waxaan ku eegaynaa dhammaan sifooyinka cusub ee (New)PowerShell 7.0 .
Isbeddellada Hagaha PowerShell
Markaad rakibto PowerShell 7(install PowerShell 7) , waxay ku rakibi doontaa hage cusub, oo ay la socoto PowerShell 5.1 . Haddii aad ka cusboonaysiinayso PowerShell Core 6.x , markaa waxay dib u qori doontaa tusaha PowerShell 6 , oo waxay ka saari doontaa dhammaan faylasha aan loo baahnayn. Waa kan liiska hagayaasha ay tahay inaad ogaato:
PowerShell 7 ayaa lagu rakibay si-
%programfiles%\PowerShell\7
Galka %programfiles%\PowerShell\7 waxa lagu daraa $env:PATH
Xirmooyinka rakibayaasha PowerShell 7 waxay cusboonaysiiyaan noocyadii hore ee PowerShell Core 6.x :
PowerShell Core 6.x ee Windows:(PowerShell Core 6.x on Windows:)
%programfiles%\PowerShell\6
waxaa lagu bedelayÂ
%programfiles%\PowerShell\7
Linux:
/opt/microsoft/powershell/6
waxaa lagu bedelayÂ
/opt/microsoft/powershell/7
macOS:Â (macOS: )
/usr/local/microsoft/powershell/6
waxaa lagu bedelay
/usr/local/microsoft/powershell/7
Tilmaamo cusub oo ku jira PowerShell 7
Waxaan isku dayay inaan si kooban u sharaxo mid kasta oo ka mid ah sifooyinkan iyo sida ay u caawin doonto isticmaalayaasha (users)PowerShell . Si kastaba ha ahaatee, hubi inaad si faahfaahsan u akhrido bogga rasmiga ah ee Microsoft .
- Isbarbardhigga dhuumaha
- Hawl-wadeenno cusub
- ConciseView iyo Hel-Error(Get-Error) cmdlet
- Ogaysiisyada nooca cusub ee tooska ah
- (Invoke DSC)Si toos ah uga wac ilaha DSC PowerShell 7
- Lakabka waafaqid
Had iyo jeer hubi inaad hubiso Bedelka Deegaanka(Environment Variable) ka hor inta aanad tijaabin koodka dhabta ah.
1] Isbarbardhigga Dhuumaha
Hadda waxaad samayn kartaa ama u maarayn kartaa walxaha si isbarbar socda halkii aad ka isticmaali lahayd habka isku xigxiga marka aad isticmaalayso ForEach-Object -Parallel. Boostadayada ku saabsan uninstalling WIM , habkani wuxuu soo saari karaa saddex sawir oo WIM ah wax ka yar 10 ilbiriqsi halkii uu ka ahaan lahaa ku dhawaad 25 ilbiriqsi marka uu si isdaba joog ah u socdo. Halkan waxaa ah kood muunad ah:
Get-WindowsImage -Mounted | foreach -Parallel {Measure-Command {Dismount-WindowsImage -Discard -Path $_.Path}}
2] Hawl-wadeenno cusub
Waxa jira saddex hawlwadeen oo cusub— Ternary operator: a ? b : c, Pipeline chain operators: || and && and Null conditional operators: ?? and ??=.Kuwaani waxay u dhaqmaan sida hadal la fududeeyay haddii kale. (behaves like a simplified if-else statement.)Waxay fududeeyaan qoritaanka koodka halkii ay isticmaali lahaayeen loop-ka-kale mar walba.
3] ConciseView iyo Hel-Error cmdlet
ConciseView waa aragti la dooran karo adeegsadaha kaas oo karti loo siiyay sidii aragtida caadiga ah ee PowerShell 7 . Haddii qaladku aanu ka ahayn qoraalka, waxaad heli doontaa hal khad. Si kastaba ha ahaatee, haddii ay ka timid qoraalka ama uu jiro qalad kala saarid, waxaad heli doontaa fariin qalad ah oo badan, iyo tilmaame muujinaya xariiqa qaladku ka dhacay.
Markaa waxaad haysataa cmdlet Get-Error cusub kaas oo kaa caawin kara inaad aragti faahfaahsan ka hesho qaladka markaad rabto. Waxay soo bandhigi kartaa faahfaahin buuxda, oo ay ku jiraan ka-reebitaanka gudaha, ee khaladkii ugu dambeeyay ee dhacay.
$Error | Get-Error Get-Error -Newest 3 # Displays the last three errors that occurred in the session
4 ](] Automatic) Ogaysiisyo nooca cusub oo toos ah
Laga bilaabo PowerShell 7 , nidaamku wuxuu hubin doonaa cusboonaysiinta hal mar maalintii wuxuuna ogeysiin doonaa nooc cusub haddii la heli karo. Macluumaadka waxa la tusay kaliya bilowga kalfadhiyada xiga. Waxaa jira saddex calan oo loo heli karo Cusbooneysiinta PowerShell(PowerShell Update)
- Default GA, Horudhac iyo sii deynta RC
- Demi(Off) Â waxay damisaa habka wargelinta ee cusboonaysiinta
- LTS kaliya waxa ay ogaysiisaa wararka ku saabsan sii daynta adeega muddada-dheer ( LTS ) GA
Haddii aad rabto inaad damiso ogaysiisyada cusboonaysiinta ee PowerShell 7 , ku dhaqan amarkan daaqadda PowerShell .
$Env:POWERSHELL_UPDATECHECK = 'Off'
5] Si toos ah uga wac ilaha DSC (Invoke DSC)PowerShell 7
The Invoke-DscResource(Invoke-DscResource) cmdlet waxa ay waddaa hab cayiman ee PowerShell Desired State Configuration ( DSC ). Waa muuqaal tijaabo ah.
Using this cmdlet, configuration management products can manage Windows or Linux by using DSC resources. This cmdlet also enables debugging of resources when the DSC engine is running with debugging enabled.
6] Lakabka waafaqid
Waxay u ogolaataa isticmaalayaasha PowerShell inay soo dejiyaan cutubyada fadhiga Windows PowerShell ee daahsoon. (Windows PowerShell)Isticmaalka tan, waxaad awood u yeelan doontaa inaad amarka dhabta ah ku qaadato kombiyuuterka fog oo aad ku celiso natiijooyinka fadhiga maxalliga ah. Hadda oo ay taageerto soo dejinta modules, waxaad ku socodsiin kartaa modules-yada kombiyuutarada fog.
PowerShell waa software il furan oo laga heli karo Linux iyo macOS sidoo kale. Aad ayey u fiican tahay in lagu arko astaamo badan oo cusub PowerShell 7 , waxaana rajeyneynaa inay sii kordheyso. Waxaad wax badan oo ku saabsan ka akhrisan kartaa Microsoft(about it on Microsoft) .
Related posts
Ku rakib oo u beddel Luqadda Bandhigga Cusub ee Windows 7 oo wata Vistalizator
Ku rakib oo u beddel Luqadda Bandhigga Cusub ee Windows 7 Guriga & Pro
Ku rakib oo u beddel Luqadda Bandhigga Cusub ee Windows 7 Ultimate
Maxaa Ka Cusub Windows 8 Mawduucyada? Waa maxay sababta aysan ugu shaqayn Windows 7?
Daaqadaha lumay Windows 7? Mid Cusub Ka Samee xoqdo
Sida dib loogu dajiyo abka Microsoft Store iyadoo la isticmaalayo PowerShell gudaha Windows 10
Sida loo tirtiro ama loo abuuro hawl la qorsheeyay ee PowerShell gudaha Windows 11
Cilad ku samee arrimaha isku xirka Windows Server Network adoo isticmaalaya PowerShell
Sida loo helo ciwaanka IP-ga dadweynaha adoo isticmaalaya PowerShell gudaha Windows 10
Microsoft PowerShell Script Browser wuxuu kaa caawinayaa inaad si fudud u hesho muunado qoraal ah
Dami Su'aalaha Amniga gudaha Windows 11/10 adoo isticmaalaya qoraalka PowerShell
PowerShell Get-Appxpackage Aan shaqayn ama Galitaanka waa la diiday
Daar Desktop Fog adoo isticmaalaya Command Prompt ama PowerShell
Beddel erayga sirta ah ee Koontada Maxalliga ah adigoo isticmaalaya Command Prompt ama PowerShell
PowerShell wuxuu ka furmayaa Bilawga gudaha Windows 11/10
Ku beddel Command Prompt PowerShell gudaha WinX Menu of Windows 10
Ku soo celi Command Prompt halka aad ka ahaan lahayd PowerShell gudaha Explorer
Sida loo rakibo Google Chrome adoo isticmaalaya Windows PowerShell
Sida loo furo degdega PowerShell ee gudaha Windows 11/10
Sida loo hubiyo nooca PowerShell gudaha Windows 11/10