When Microsoft developed PowerShell (PS) inward Nov 2006, the aim was to wed a command-line based interface as well as a scripting linguistic communication to cause got trouble automation as well as configuration management of native Microsoft applications. Through the years it has seen upgrades that increment its functionality, amongst to a greater extent than cmdlets (PS commands) as well as to a greater extent than back upward through importing modules to grant the framework greater flexibility inward managing a multifariousness of services.
As PowerShell's popularity has increased, its adoption charge per unit of measurement has fueled farther changes. Arguably the largest as well as most recent of these was Microsoft's determination to brand PS opened upward source, porting it to diverse Linux distributions as well as macOS as well as enabling cross-platform back upward through i unified shell. What does this hateful for non-PowerShell users? Simply put, PS is poised to non exclusively supersede the venerable ascendency draw that Windows admins know—but every bit organizations grow their user base of operations amongst Linux as well as macOS-based devices, admins tin port that noesis over to managing those devices every bit well, all from i console or shell.
For those who back upward Windows-only organizations, Microsoft has made inroads toward PS-based management yesteryear ensuring that much of its higher-level software, such every bit Windows Server, Active Directory, as well as Exchange, volition travel 100% manageable exclusively through PowerShell. Users managing services through the GUI or admin consoles won't travel able to fully configure every aspect of the application unless they switch to PowerShell. So hither are roughly unremarkably used commands yous may notice are component subdivision of your daily admin tasks—and the PS equivalent—to assistance yous migrate your usage over to PowerShell.
SEE: Windows administrator's PowerShell script kit (Tech Pro Research)
1. Changing directories
CMD: cd
PS: Set-Location "path/to/directory"
2. Listing files inward a directory
CMD: dir
PS: Get-ChildItem
3. Renaming files
CMD: rename
PS: Rename-Item "path/to/file.ext" -NewName "newfilename.ext"
4. Getting assistance for a command
CMD: /?
PS: Get-Help "Cmdlet name"
5. Stopping processes
CMD: taskkill
PS: Stop-Process -Name "application.exe"
6. Forcing Group Policy refresh
CMD: gpupdate /force
PS: Invoke-GPUpdate -Computer "Hostname" -Force
7. Shutting downwards local (or remote) computer(s)
CMD: shutdown -s
PS: Stop-Computer -ComputerName "Hostname1","Hostname2", "localhost"
8. Restarting local (or remote) computer(s)
CMD: shutdown -r
PS: Restart-Computer -ComputerName "Hostname3", "localhost"
9. Setting variables
CMD: SET variable="value"
PS: $"variablename" = "value"
10. Joining a reckoner to a domain
CMD: netdom /domain:domainname /user:username /password:password fellow member hostname /add
PS: Add-Computer -DomainName "Domain" -Credential "Domain\Username" -Restart
Starting point
While this listing is inward no means exhaustive, it's a practiced outset measuring toward treading PowerShell's relatively deep waters inward a means that allows yous to acquire hands-on sense using it. It likewise provides a practiced jumping-off indicate for those who desire to navigate farther into PS as well as larn to a greater extent than virtually how its cmdlets tin travel exist used for greater manageability as well as to automate daily, repetitive tasks.
Also read...
- PowerShell: The smart person's guide (TechRepublic)
- 10 PowerShell commands every Windows admin should know (TechRepublic)
- 10 reasons why yous should larn to work PowerShell (TechRepublic)
- Microsoft delivers PowerShell inwardness for Windows, Linux, Mac (ZDNet)
- Microsoft opened upward sources PowerShell; brings it to Linux as well as Mac OS X (ZDnet)
Other tips for transitioning to PS?
What cmdlets select yous started using to simplify command-line tasks? Share your advice amongst swain TechRepublic members.