Waa maxay PWSH.EXE? Liiska PWSH syntax ee aad isticmaali karto
PowerShell waa mid ka mid ah aaladaha qoraalka ugu awoodda badan ee Microsoft ay abuurtay. Maqaalkan, waxaanu ku wadaagi doonaa waxa PWSH.exe , iyo liiska muhiimka ah ee PWSH syntax . Waxaan hubaa in qaar badan oo ka mid ah adeegsigu ay isticmaaleen Windows PowerShell , laakiin PWSH hadda waa qalab qoraal ah oo iskutallaab ah oo ka shaqeeya Windows , macOS, iyo Linux . Si kastaba ha ahaatee, laguma taageero WSL ie Windows Subsystem -ka Linux , iyo isku dayga lagu dejiyo PWSH sida qolofka gelitaanka waxay u horseedi doontaa WSL aan degganayn .
Waa maxay PWSH.EXE?
Kahor intaanan bilaabin, aan sifeyno hal tafatir. PWSH.EXE waa magaca cusub ee PowerShell . Tan iyo nooca 6 waxaa loo yaqaan PowerShell Core . Markii hore waxaa loogu magac daray powershell.exe oo ay tahay inaad ku aragtay Windows (nooca 5.1). La yaab ma leh mar kasta oo aad PowerShell ka bilowdo Windows , waxaad helaysaa farriin:
“Try the new cross-platform PowerShell https://aka.ms/pscore6.”
Waxaad ka akhrisan kartaa farqiga u dhexeeya PowerShell iyo PowerShell Core.(difference between PowerShell and PowerShell Core.)
Si degdeg ah maanta, PowerShell waxay gaartay nooca 7(PowerShell has reached version 7) oo ah isbeddel weyn marka loo eego nooca 6 oo adeegsada .NET Core 3 halkii uu ka isticmaali lahaa . Net Framework . Haddii aad rabto inaad tijaabiso, baro sida loogu rakibo PowerShell 7.0 Windows 10.(how to install PowerShell 7.0 on Windows 10.)
Falanqaynta PWSH ee muhiimka ah
-File | -f: Haddii aad amar ku leedahay faylka qoraalka, waxaad u isticmaali kartaa gelis ahaan. Waxaad sidoo kale u doodi kartaa faylasha marka ay khuseyso.
pwsh -File .\test.ps1 -TestParam $env:windir
-Command | -c : Isticmaal kan si aad ufuliso amar ama ScriptBlock . ScriptBlock waa hawlo loo dejiyay oo ku lifaaqan {}
pwsh -Command {Get-WinEvent -LogName security}
ama
@' "in" "hi" | % { "$_ there" } "out" '@ | powershell -NoProfile -Command -
-EncodedCommand | -e | -ec : Isticmaal tan marka ay jirto baahi loo qabo in la isticmaalo calaamado xigasho oo adag ama xargo-duuban.
$command = 'dir "c:\program files" ' $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) $encodedCommand = [Convert]::ToBase64String($bytes) pwsh -encodedcommand $encodedCommand
-Login | -l: Linux iyo macOS, waxay ku bilaabataa PowerShell sidii qolof gal (PowerShell)ah(Linux) , adoo isticmaalaya / bin / sh si loo fuliyo profiles galitaanka sida /etc/profile iyo ~/.profile. Ma khusayso Windows .
Waa inaad xaqiijisaa jidka saxda ah ee ku hoos qoran /etc/shells. Waxaad isticmaali kartaa utility chsh si aad u dejiso qolofka isticmaalahaaga hadda pwsh.
chsh -s /usr/bin/pwsh
-SettingsFile | -goobaha
Haddii aad rabto in aad ku qorto goobaha caalamiga ah ee goobaha mashruuca maxaliga ah, markaa waxaad qeexi kartaa faylka dejinta adoo isticmaalaya doorashadan. Dejinta nidaamka-ballaaran ayaa laga helayaa powershell.config.json.
pwsh -SettingsFile c:\myproject\powershell.config.json
Liiska PWSH oo dhammaystiran
pwsh[.exe] [[-File] <filePath> [args]] [-Command { - | <script-block> [-args <arg-array>] | <string> [<CommandParameters>] } ] [-ConfigurationName <string>] [-CustomPipeName <string>] [-EncodedCommand <Base64EncodedCommand>] [-ExecutionPolicy <ExecutionPolicy>] [-InputFormat {Text | XML}] [-Interactive] [-Login] [-MTA] [-NoExit] [-NoLogo] [-NonInteractive] [-NoProfile] [-OutputFormat {Text | XML}] [-SettingsFile <SettingsFilePath>] [-STA] [-Version] [-WindowStyle <style>] [-WorkingDirectory <directoryPath>] pwsh[.exe] -h | -Help | -? | /?
Haddii aad u baahan tahay faahfaahin dheeraad ah, waxaad booqan kartaa docs.microsoft.com.
Related posts
Dami Su'aalaha Amniga gudaha Windows 11/10 adoo isticmaalaya qoraalka PowerShell
Hubi Windows 10 qaab dhismeedka OS adoo isticmaalaya PowerShell ama Command Prompt
Samee barta soo celinta nidaamka adoo isticmaalaya Command Prompt ama PowerShell
Sida loo isticmaalo Windows PowerShell ISE - Beginners Tutorial
Sida MAR WALBA loo socodsiiyo Command Prompt iyo PowerShell maamule ahaan
Sida loo helo ciwaanka IP-ga dadweynaha adoo isticmaalaya PowerShell gudaha Windows 10
PowerShell wuxuu ka furmayaa Bilawga gudaha Windows 11/10
Daar Desktop Fog adoo isticmaalaya Command Prompt ama PowerShell
Sida loo jadwaleeyo qoraalka PowerShell ee Jadwalka Hawsha ee Windows 10
Dib u dabee macmiilka Cusboonaysiinta Windows adoo isticmaalaya PowerShell Script
Liis garee jaangooyooyinka kombiyuutarka ee BIOS adoo isticmaalaya moduleka GetBIOS PowerShell
Sida loo helo oo loo joojiyo kamaradaha Webka adoo isticmaalaya PowerShell gudaha Windows 10
Habbee gelitaanka galka la xakameeyey adoo isticmaalaya Siyaasadda Kooxda & PowerShell
Ku beddel Command Prompt PowerShell gudaha WinX Menu of Windows 10
Sida loo qariyo cusboonaysiinta Windows adoo isticmaalaya PowerShell gudaha Windows 11/10
PowerShell Get-Appxpackage Aan shaqayn ama Galitaanka waa la diiday
Beddel erayga sirta ah ee Koontada Maxalliga ah adigoo isticmaalaya Command Prompt ama PowerShell
Sida loo Zip oo furto faylasha adoo isticmaalaya PowerShell gudaha Windows 11/10
U beddelo qoraalka PowerShell (PS1) faylka EXE oo wata IExpress gudaha Windows 10
Sida loo furo degdega PowerShell ee gudaha Windows 11/10