Sunday, 4 January 2015

First Time PowerShell user?

First Time PowerShell user?

    I hear a lot and infact felt isolated when I've launched the PowerShell console for the first time and I think the unix console windows might have scared us to core to exhibit this common behaviour for windows guys or we are GUI stuck! :)
 
How to overcome the First Time issues?
    Step 1
         Just launch it believing its the extended version of Windows Command Prompt with a different color theme and I would like to highlight this "PowerShell supports all native windows commands".
When you launch for the first time.... try the dir, cd , date, time, ping etc it works!

   Step 2.
        Pin the PowerShell icon to the 'taskbar' on your system and start working with it by slowly replacing the 'cmd.exe' to PowerShell and start with the basic commands in PowerShell.

   Step 3.
        This would allow you to explore the new powerful console and what it could offer you on the long run and avoid cmd.exe as much as possible.

Bottom line for this simple strategy is to allow you to get more familiar with PowerShell, and yay! it looks cool.

Some DOS to PS basics for you to try ..

Change a Directory
  • DOS: cd
  • PowerShell: Set-Location
List Files in a Directory
  • DOS: dir
  • PowerShell: Get-ChildItem
Rename a File:
  • DOS: rename
  • PowerShell: Rename-Item 
Find Date:

  • DOS : date
  • PowerShell: Get-Date

We would certainly get into depth of each command, but I would recommend you to observer the PowerShell commandlets carefully.

PowerShell commandlets follow a Verb-Noun format. Example (get-date : get-verb, date-noun)

Give it a try: Guess what would be the PowerShell commandlet for checking all the services on a system?

If your answer is (Get-Service) .. way to go! if not, still long way to go :)

Procedure to Pin PowerShell to Taskbar and How to launch PowerShell console.

Its important to launch PowerShell with "Elevated Privileges" on a system to avoid any issues while executing the commandlets.

Right Click on Windows PowerShell and select "Pin to Taskbar"







Then Right Click on the PowerShell Icon and Select "Run as Administrator". Just remember this should be the standard procedure of launching PowerShell to avoid any errors related to permissions.

















The PowerShell Console should always have "Administrator" on the Titlebar just to be sure you are Administrator and powershell is running with Administrator privileges.



No comments:

Post a Comment