SP HAMMAD
Menu

SKILLS & TRICKS

ABCD of PowerShell & Automating SharePoint 2016 Installation

11/13/2017

3 Comments

 
​Some of us have already worked with PowerShell and love it, while others seem to be confused and wonder how can one remember so many commands to get things done. Maybe its time we break it down for the guys who find it difficult to work with and show them how powerful it is when dealing with every day tasks related to SharePoint - for both Admins and Developers.

What is PowerShell

Its a scripting language and very similar to batch jobs which are simply plain-text files that execute through a console application to achieve automation tasks on a machine.

I have heard a few people referring to it as a tool or framework and i disagree with this approach. Lets just keep PowerShell a simple plain human-readable language.

What does it Contain, where do we write it and how do we run it

It contains logic loops, variable, methods and other entities from the programming world. 

The scripts can be written using any text editor and i usually write my PowerShell scripts using Notepad++ and then save it as a plain-text file having a .ps1 extension. To run the scripts you can initiate PowerShell console session and its basically the command-line console with blue as background color and text in white.  You can always change the background color  to suit your needs.

The following line will  print a line of red text on a yellow background:

Write-Host "See how cool this is?" -Backgroundcolor
orange -Foregroundcolor black


The console keeps the various variable declarations in memory for the entire duration of the PowerShell session. The image below shows you a fairly simple PowerShell session in which variables have been declared and are remembered throughout the execution of the various commands. It starts by declaring two variables, variableA and variableB, whose values will later be reused to perform mathematical operations. The script continues by changing the value of one of the two variables already declared and rerunning the same addition operation to get a different result based on the new value entered.

Read More
3 Comments

    Archives

    February 2020
    January 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    November 2017
    October 2017
    April 2017
    March 2017
    February 2017
    January 2017
    November 2016
    July 2016
    December 2014

    Categories

    All
    Agile
    Analysis Of Metrics
    CMS
    DevOps
    Digital Workplace
    Guideline
    Microsoft
    Microsoft Azure
    Microsoft Teams
    Microsoft WPC 2016
    MS Ignite
    Niteco
    Office 365
    Office 365 CDN
    Personalization
    PowerShell
    Project Management
    Scrum
    SharePoint
    SharePoint 2013
    SharePoint 2016
    SharePoint Framework
    Sitecore
    Sitecore 9
    Sitecore Symposium
    Software Project Audit

    RSS Feed

    Picture

Feel free to connect and Subscribe for updates!

SKYPE

hammad.ahmad

Telephone

+62 81316905997

Email

hammad@sphammad.com
  • Home
  • About Me
  • Blog
  • Contact
  • Home
  • About Me
  • Blog
  • Contact