Posts

My First PowerShell Script

So after installing the windows powershell in your machine, let's start with your first scripting step. 1. Open the PowerShell in Administrative ISE mode, for that search powershell ISE, right click then run as admin, put on your domain credentials and then press enter or if it does not asks for your credentials then simply click " Yes ". It would take 1 min to load up ISE. 2. Goto Script Pane  and then try with below script: Get-Service  -Name  *server*   |   Select-Object   Status ,  StartType ,   Name ,  DisplayName |  Sort-Object   StartType  | Format-Table  -AutoSize The above script would provide you list of services on which service name contains server. It would also provide you Status (Running or Not Running), StartType (Automatic, Manual or Disabled), service name and it's display name of the service. Syntax : cmdlet -Property <Property Name> Every command-let has it's property and you may use...

Getting started with Powershell

Image
So, now we know what is powershell, command-lets and modules. Hope you have played around with Get commands. In this blog we'll see how to install powershell and try to understand its console. We'll also discuss few shortcut keys to improve and ease out our work. Installing Powershell Windows Powershell is by-default installed on all Windows machines, starting from Windows 7 to Windows 2019. If you want to install Powershell 6 then install Powershell core instead of Windows powershell. For more info click on  Installing Powershell 6 . How to find Powershell if installed in your machine or not? Go-to left corner of your Windows server(2012, 2016 and 2019)/desktop(8 and 10), and click on search button and type Powershell or Press Windows Icon from your keyboard and then type Powershell, in any of the ways you'll get powershell tool. If you are using windows 7 or windows 2008 machines then you may click on Start button and then search for Powershell keyw...

Command-Lets and Module

Image
In Previous blog I have explained briefly about Powershell and uses of Help command. In this blog we'll discuss in detail about Command Lets and Module. So let's begin!! What are Command Lets?? Command lets are the in built functions or in other word you say commands which are used in various powershell scripting. These commands can get values of object properties or even can modify its values for example you have a service and you want to stop that command, well in that case stop-service command let is used to stop the service. Note these command lets are powerful enough that it can break your production environment and you may be in trouble . My motive is not make you fear for powershell, its just a FYI that what a powershell can do to your live running environment. I would suggest you to play around Get Command let this will not break anything :) Every Command let in powershell is made up of two basic parts of speech from english grammer, Verb and Noun. Get-Service ...

PowerShell and 'Get-Help' Basics

Image
Hi Viewers, hope you all are doing well!. This is my First blog of 2019. In this blog we'll learn about a bit of powershell and its components and gradually we'll learn how to make scripts in upcoming blogs. We'll also get an idea of command-lets which would help in enhancing our scripting skills. So lets get started with PowerShell Basics.. Firstly you should know What is PowerShell and why it was discovered. PowerShell is not a scripting tool ... Does this seems crazy? Yes you heard it right PowerShell is not a scripting tool though its used to create scripts or to create automation tools or to do automation but the primary function of powershell tool is to perform real time management functions or you can say its a interactive real time management command tool which allows you or system engineer to manage system resources beat if its users, applications, servers or deployments etc... This was Discovered by Jeffrey Snover who is currently Technical Fellow...