EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials PowerShell Tutorial PowerShell Versions
Secondary Sidebar
PowerShell Tutorial
  • Basics
    • PowerShell Restart Service
    • PowerShell comment
    • PowerShell Map Network Drive
    • PowerShell Append to File
    • PowerShell print
    • What is PowerShell
    • Uses Of Powershell
    • PowerShell Empire
    • PowerShell Parameter
    • PowerShell Stop Service
    • PowerShell Versions
    • How To Install PowerShell
    • PowerShell uninstall module
    • How to Use PowerShell?
    • PowerShell Logging
    • PowerShell Tools
    • PowerShell Commands
    • PowerShell Version Command
    • PowerShell Administrator
    • PowerShell Modules
    • PowerShell Registry
    • PowerShell block Comment
    • PowerShell Verbs
    • PowerShell list
    • PowerShell add user to group
    • PowerShell Write to Console
    • Variable in PowerShell
    • PowerShell New Line
    • PowerShell prompt for input
    • PowerShell File Extension
    • Powershell Remotesigned
    • PowerShell Write to File
    • PowerShell Ping
    • PowerShell wget
    • PowerShell Global variable
    • PowerShell Get-ADGroup
    • Array in PowerShell
    • PowerShell Multidimensional Array
    • PowerShell Array of Strings
    • PowerShell? join array
    • Useful PowerShell Scripts
    • String in PowerShell
    • PowerShell Switch Statement
    • PowerShell Function Parameters
    • PowerShell vs PowerShell ISE
    • PowerShell test-connection
    • PowerShell Test-NetConnection
    • PowerShell GUI
    • PowerShell Variable in String
    • PowerShell Active Directory
  • Variables
    • PowerShell Variables
    • PowerShell Environment Variables
    • PowerShell set environment variable
    • Hashtable in PowerShell
    • Set Variable in PowerShell
  • Operators
    • PowerShell Operators
    • Comparison Operators in PowerShell
    • Logical Operators in PowerShell
    • PowerShell Boolean
    • PowerShell Like Operator
  • cmdlet
    • PowerShell Wait
    • PowerShell Match
    • cmdlets in PowerShell
    • Start PowerShell from cmd
    • Add-Content in PowerShell
    • Get Help in PowerShell
    • PowerShell Copy-Item
    • PowerShell Remove-Item
    • PowerShell Move-Item
    • Get Command in PowerShell
    • PowerShell Run Command
    • Windows PowerShell ISE
    • Windows Powershell Commands
    • WinRM PowerShell
    • PowerShell Date
    • Powershell Write-Host
    • PowerShell Get-ChildItem
    • PowerShell Sort-Object
    • PowerShell Where Object
    • PowerShell Set-Content
    • PowerShell Set-Location
    • PowerShell Invoke-Command
    • PowerShell Invoke-Webrequest
    • PowerShell Get-Location
    • PowerShell Get-Date
    • PowerShell Get-Service
    • PowerShell Test-Path
    • Powershell Module Path
    • PowerShell Out-File
    • PowerShell if File Exists
    • Powershell Copy File
    • PowerShell Delete File
    • PowerShell New-Item
    • PowerShell Rename-Item
    • PowerShell ComputerName
    • PowerShell Get-Content
    • PowerShell Get-Item
    • PowerShell Get-ADUser
    • PowerShell Grep
    • PowerShell Concatenate String
    • PowerShell Get-Process
    • PowerShell Count
    • PowerShell pause
  • Control Statements
    • If Statement in PowerShell
    • If Else in PowerShell
    • Else If in PowerShell
    • Loops in PowerShell
    • For loop in PowerShell
    • PowerShell While Loop
    • PowerShell do while
    • PowerShell Loop through Array
    • PowerShell add to array
    • PowerShell ForEach Loop
    • PowerShell Break
    • PowerShell Continue
    • Switch Case in PowerShell
    • PowerShell If-Not
    • Try-catch in PowerShell
  • Functions
    • PowerShell Functions
    • PowerShell String Functions
    • powershell nslookup
    • PowerShell here string
    • PowerShell Wildcards
    • Regex in PowerShell
    • PowerShell not like
    • PowerShell Filter
    • PowerShell Sleep
    • PowerShell where
    • PowerShell join string
    • PowerShell Exit
    • PowerShell null
    • PowerShell Dictionary
    • PowerShell Location
    • PowerShell Start-Service
    • PowerShell is not digitally signed
    • PowerShell Uptime
    • PowerShell Create Directory
    • PowerShell Trim
    • PowerShell Join-Path
    • PowerShell Execution Policy
    • PowerShell SubString
    • PowerShell Format Table
    • PowerShell Import Module
    • PowerShell ForEach Object
    • PowerShell Alias
    • PowerShell Scheduled Task
    • PowerShell Convert String to Date
    • PowerShell Split String
    • PowerShell Multiline String
    • PowerShell MultiLine Comment
    • PowerShell Rename Folder
    • PowerShell Delete Folder
    • PowerShell String Replace
    • PowerShell join
    • PowerShell xcopy
    • PowerShell Base64
    • PowerShell Tail
    • PowerShell User List
    • PowerShell remove User from group
    • PowerShell JSON Format
    • PowerShell Send Mail
    • PowerShell Convert to String
    • PowerShell Start-Process
    • PowerShell change directory
    • PowerShell Open File
    • PowerShell Batch File
    • PowerShell ZIP
    • PowerShell unzip
    • PowerShell XML
    • PowerShell XML Parsing
    • Remote PowerShell
    • PowerShell Escape Character
    • PowerShell scriptblock
    • PowerShell Executable Location
    • PowerShell Import-CSV?
    • PowerShell Export CSV
  • Interview Questions
    • PowerShell Interview Questions

Related Courses

Shell Scripting Course

All in One Data Science Courses

Data Visualization Courses

PowerShell Versions

By Priya PedamkarPriya Pedamkar

PowerShell Versions

Introduction to PowerShell Versions

PowerShell provide a command-line powerful interface to perform various automation works. If you are aware of Linux and mac command line, PowerShell command-line is the same. PowerShell’s first release was in 2006 with its version 1.0. This version supports Windows XP SP2, Windows Server 2003 SPI, and Windows Vista. Every version comes with a few more supports and commands. So currently PowerShell version 6 is going on as stable version and 7 is about to come. PowerShell version 6 supports Windows, Mac, and Linux operating systems. So in very simple terms, the biggest change in its version is support for another platform, which means support for operating systems other than Windows. In another version, there are additions of a few more commands and syntax.

Different Versions of PowerShell

Below are the 9 Different versions of PowerShell:

1) PowerShell 1.0

PowerShell version 1.0 was the very basic version, and it supports Windows XP SP2, Windows Server 2003 SPI, and Windows Vista.

2) PowerShell 2.0

Till PowerShell 1 we were only capable to write commands for the local machine, that is, we were only able to control local machines, but in PowerShell 2 with the help of WS-management, we can write our commands for a remote machine (remote machine means accessing others computer from your computers).

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

New changes in PowerShell 2.0 are given below:

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,650 ratings)
  • Background Jobs: Here, to invoke asynchronous any job it uses a Background job, and it waits for user input, for example, you are running any script and you want that script should ask the input value than only it should execute.
  • Introduction of Transactions: In this PowerShell provides the ability to write commands where a developer can roll back their changes.
  • Modules: This gives PowerShell the ability to self-managed, in very simple we can write a script and this script can be a command for another script, and define our own features to be used in other scripts.
  • Data Language: It allows localization, means we can write a script on one domain and when the same script will run on other domains then the local string will be imported at the runtime of script.
  • Debugging of Scripts: It allows us to set any breakpoint into the script for debugging.
  • Network File Transfer: With the introduction of Background Intelligent Transfer Service in PowerShell, it becomes able to asynchronous file transfer between two machines.

3) PowerShell 3.0

PowerShell 3.0 releases on 02 December 2011 and it supported Windows 7,8 including Windows Server 2012. The new improvements are given below:

  • Jobs Scheduling: We can set any time for jobs to be run, for example, if you have jobs A, B, C then it can be scheduled time for execution of all these jobs.
  • Session Connectivity: Control over remote sessions, When a script needs it can connect and disconnect to session.
  • Support for Delegation: It can delegate a user with less permission for Administrative tasks.
  • Detect Automatic Modules: It gives power to PowerShell scripts to load modules implicitly when it was needed by scripts.

New Commands and Features: There are many new commands also added in this version, like get-WmiObject, dwin32_logicaldisk, volumes, firewalls, It also includes network connectivity and also allows us to handle printers.

4) PowerShell 4.0

in this version, it starts supporting Windows 8.1 and Windows Server 2012 R2. PowerShell 4.0 introduced a few new features they are.

  • Save-Help: One of the important improvements in PowerShell 4.0 is it allow you to save Help for that module which is remote.
  • Improved Debugging: Debugging was already there, but i PowerShell 4.0 it comes with few more debugging features like workflow support, able to execute remote debug remote machine.
  • Switch Option in -PipelineVariable: To expose the current pipeline we use PipelineVariable.
  • Desired State Configuration: In simple terms, this version of PowerShell allows us to configure a system where it can recognize the machine.
  • Where and ForEach: Where and ForEach method syntax provides an alternate method of filtering and iterating over objects.

Example:

The example of foreach in the below screen, here we are displaying all numbers except number 5, this could be useful for filtering data.

foreach ($num in 1,2,3,4,5,6,7,8,9,10) {
if ($num -eq 5) { continue } ; $num
}

Output:

filtering data

Example:

The Example of where is given below:

Get-ChildItem ./ranjan/ranjan1/ | where Length -gt 10

Output:

PowerShell Versions 1-2

5) PowerShell 5.0

The main features include in PowerShell 5.0 are OneGet command which supports Chocolatey’s.

Example:

It introduced two new commands called Get-TimeZone and Set-TimeZone.

Get-TimeZone

Output:

TimeZone

6) PowerShell 6.0

This release was one of the measured releases, as in this release is made PowerShell as cross-platform. Cross-platform means are independent of any operating system(support, for example, macOS, Linux, and Windows). It becomes free and completely open-source. This release was achieved on 10th January 2018 and it is available for Windows, macOS, and Linux.

7) PowerShell Core 6.1

Some of the important features added in 6.1 are given below:

  • Ability to support 1900 commands to Windows 10 and Windows Server 2019.
  • It builds on .NET core 2.1.
  • support all new versions of Windows, macOS, and Linux.
  • There was also an improvement in performance.

8) PowerShell Core 6.2

In this release mostly bug fixing and some performance enhancements work has been done.

Example:

In this example, I am using PowerShell 6.2 and checking my Operating system details.

Get-Host | Select-Object Version
$PSVersionTable

Output:

Get-Host

The above example shows how I am able to run PowerShell on Linux with PowerShell version 6.2. If i will go with any older version than it would not work.

9) PowerShell 7

New features in PowerShell 7 include:

  • It is based on the .NET Core 3.1.
  • ForEach-Object -Parallel.
  • Windows compatibility wrapper.
  • Notification for new versions.
  • Get-Error cmdlet to handle errors powerShell.
  • Options for Pipeline chain operators which is && and ||.
  • It includes ternary operators like (x ? y: z), so if you are using PowerShell version 7 then the only a ternary operator will work.
  • Out-GridView, -ShowWindow are some new commands.
Note: The ternary operation will not work if you are using lower than 7 versions. See the example below:

PowerShell Versions 1-5

Conclusion

From version 1 to 7 every version comes with some new commands and features, but they did big architectural changes by supporting operating systems other than Windows like macOS and Linux.

Recommended Articles

This is a guide to PowerShell Versions. Here we discuss the basic concept and top 9 different PowerShell versions along with the examples. You may also look at the following articles to learn more –

  1. NFS in Linux
  2. PowerShell Environment Variables
  3. Regex in PowerShell
  4. PowerShell Rename-Item
Popular Course in this category
All in One Data Science Bundle (360+ Courses, 50+ projects)
  360+ Online Courses |  1500+ Hours |  Verifiable Certificates |  Lifetime Access
4.7
Price

View Course

Related Courses

Shell Scripting Training (4 Courses, 1 Project)4.9
Data Visualization Training (15 Courses, 5+ Projects)4.8
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more