PowerShell is Microsoft’s option to their ain Command Prompt. Earlier, Microsoft announced that they volition hold out open sourcing PowerShell in addition to volition hold out bringing it to recent versions of dissimilar Linux flavors similar Ubuntu, CentOS, Red Hat Enterprise Linux, OpenSUSE, Fedora in addition to macOS. They also released PowerShell Core which offered far to a greater extent than features than the before edition of Powershell that was shipped along amongst Windows. It was built for System Administrators and meant to cash inwards one's chips an option the Command Prompt. With this cross-platform expansion of PowerShell, the users volition scope benefits to operate on dissimilar operating systems in addition to environments.
Along the years, PowerShell has been worked on in addition to upgraded to back upwardly to a greater extent than cmdlets or PowerShell commands merely to enable it to hold out flexible plenty to cope a multifariousness of tasks. For organizations that run Windows-only software in addition to services, Microsoft has been edifice their services similar Windows Server, Azure Active Directory, in addition to Exchange to hold out able to hold out managed yesteryear using PowerShell. This results inwards amend usage of the services, rather than using GUI based configuration managers, in addition to that helps inwards saving a lot of logistical costs inwards the long term.
Equivalent CMD commands that tin hold out executed on PowerShell
Today, nosotros volition hold out talking close some basic commands for CMD that tin hold out executed using PowerShell ascendance describe of piece of job too.
1] If you lot desire to navigate to whatever place inwards the ascendance describe of piece of job it is actually simple. Where you lot use cd in Command Prompt, you lot tin use
Set-Location "<PATH>"
for the same affair within PowerShell.
2] Listing all the contents of a folder is no biggie if volition assist you lot inwards navigating through a tree of directories. For the Command Prompt, nosotros used dir, but when you lot purpose PowerShell, you lot tin merely use
Get-ChildItem
to listing all the files in addition to directories within of a directory.
3] Renaming is something that nosotros accept for granted on our 100% GUI centric operating systems. But when ane has to rename a file or a folder on a remote system, ane had to rely on the rename command acre using the Command Prompt but inwards PowerShell, they tin use
Rename-Item "Path/of/the/file.txt" - NewName "NewNameOfTheFile.csv"
Using this, the user tin alter the cite every bit good every bit the extension of the item file.
4] If you lot know a ascendance in addition to are non certain what it is about, the /? command on the Command Prompt ascendance describe of piece of job used to hold out a non bad help. Fortunately, PowerShell does non lack this feature. You tin use
Get-Help "CMDLET NAME"
to banking concern check what a CMDLET on PowerShell does.
5] Even to halt a running procedure you lot create non demand to rely on some sorts of Task Manager when you lot get got PowerShell. taskkill is a reliable ascendance on the Command Prompt, but amongst PowerShell, you lot tin use
Stop-Process -Name "ApplicationName.exe"
6] This ascendance that nosotros are going to verbalize over is something that I get got personally seen existence used inwards Schools real often. It is a real useful command. It tin hold out used to Shut downward a remote calculator or a server session. On the Command Prompt, shutdown -s can hold out used but for PowerShell,
Stop-Computer -ComputerName "HostName1","HostName2","Gateway or Address"
can hold out used to close downward a remote computer.
7] Similar to shutting downward a computer, the Command Prompt command shutdown -r, the
Restart-Computer -ComputerName "HostNameNew", Gateway or Address"
can hold out used amongst PowerShell to create the same thing.
8] If some novel changes are made to the Group Policy of a System in addition to to come across the changes, you lot demand to forcefulness refresh the Group Policy, ane used gpupdate /force on the Command Prompt. But on PowerShell, ane tin use
Invoke-GPUpdate -Computer "Name of the Host" -Force
can hold out used flawlessly.
9] To laid upwardly Variables, inwards the Command Prompt ascendance line, ane could use
SET VariableName = "Value of the Variable"
, but on PowerShell, the $ takes tending of everything. You tin merely purpose this ascendance to create the needful,
$VariableName="Value of the Variable".
10] If you lot wishing to bring together a calculator to a domain, it is pretty straightforward too. In the Command Prompt, ane could purpose this command:
netdom /domain:domainName /user:userName /password:passwordForTheDomain fellow member hostname /add
but when you lot purpose PowerShell, you lot tin leverage the purpose of
Add-Computer -DomainName "Domain" -Credential "Domain\Username" -Restart
If nosotros give away carefully, the basic Command Prompt commands cash inwards one's chips a flake complicated when executed similarly amongst PowerShell. But when nosotros verbalize close complex commands similar the Domain joining ascendance that nosotros used inwards both Command Prompt in addition to PowerShell, in addition to when nosotros observe, the ane used inwards Command Prompt is much to a greater extent than complex than the PowerShell counterpart.
Hence, nosotros tin say that the implementation of PowerShell over the Command Prompt counterpart is better. This also comprises of the fact that it is available on other platforms in addition to environments too.
We believe that Microsoft volition hold out to a greater extent than aggressively working to brand PowerShell amend than the Command Prompt in addition to non forcing users yesteryear replacing the Command Prompt amongst it.
Source: https://www.thewindowsclub.com/
comment 0 Comments
more_vert