0% found this document useful (0 votes)
7 views

powershell introduction

This document provides an overview of Windows PowerShell, including its history, versions, and configuration options for both the console and the Integrated Scripting Environment (ISE). It covers command syntax, cmdlet structure, and methods for finding commands and using help features. Additionally, it includes practical demonstrations and lab exercises to help users effectively utilize Windows PowerShell for administrative tasks.

Uploaded by

rajbharathi821
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

powershell introduction

This document provides an overview of Windows PowerShell, including its history, versions, and configuration options for both the console and the Integrated Scripting Environment (ISE). It covers command syntax, cmdlet structure, and methods for finding commands and using help features. Additionally, it includes practical demonstrations and lab exercises to help users effectively utilize Windows PowerShell for administrative tasks.

Uploaded by

rajbharathi821
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Module 1

Getting started with Windows


PowerShell
Module Overview

Overview and background of Windows


PowerShell
Understanding command syntax
• Finding commands
Lesson 1: Overview and background of
Windows PowerShell

Windows PowerShell overview


Windows PowerShell versions
Windows PowerShell vs. operating system
Two host applications
Working in mixed-version environments
Precautions when opening Windows
PowerShell
Configuring the console
Demonstration: Configuring the console
Configuring the ISE
Windows PowerShell overview

• Introduced in 2006
• Both a CLI and scripting language
• Commands include:
• Cmdlets (pronounced command-lets)
• Functions
• Filters
• Workflows

• Microsoft server applications provide


application-specific cmdlets
• Now open-source and supports Linux and
macOS
Windows PowerShell versions

2.0 3.0 4.0 5.1


Windows XP Available No No No
Windows Server 2003 Available No No No

Windows Vista Available No No No


Windows Server 2008 Available Available with No No
SP2
Windows 7 Installed Available with Available Available
SP1
Windows Server 2008 Installed Available with Available Available
R2 SP2
Windows 8 No Installed Available Available
Windows Server 2012 No Installed Available Available

Windows 8.1 and No No Installed Available


Windows Server 2012
R2
Windows 10 No No No Installed
Anniversary Edition
and Windows Server
2016
Windows PowerShell vs. operating system

• Windows PowerShell ships with specific


core, native functionality
• Most of its use, however, comes from
extensions―additional commands that
extend the capabilities of Windows
PowerShell
• Extensions are designed to work with a
specific version of Windows PowerShell, but
they do not ship with Windows PowerShell
itself
• Instead, extensions are provided as part of
an operating system or a specific product
version
Two host applications

• Console
• Basic command-line interface
• Maximum support for PowerShell features
• Minimal editing capabilities

• ISE
• Script editor and console combination
• Some Windows PowerShell features not
supported
• Rich editing capabilities

• Third-party hosting applications/editors


• Varying features and pricing
Working in mixed-version environments

• Many organizations must operate


environments that contain more than one
version of Windows PowerShell
• Use $PSVersionTable to determine the
version of Windows PowerShell on a
computer
• This course attempts to make version-
specific differences as clear as possible
Precautions when opening Windows
PowerShell
• 64-bit operating systems include 64-bit and 32-bit
versions
• 32-bit versions carry (x86) designation on icon and window
title bar
• Be certain you are opening the appropriate version for the
task at hand
• Usually, open the 64-bit version if it is available
• Ensure that the window title bar displays
Administrator if you need administrative
privileges in Windows PowerShell
• When UAC is enabled, you must right-click the application
icon to run as Administrator
• Always verify the window title bar contents when opening
Windows PowerShell
Configuring the console

• Select a font style, size, and color, and set


the screen color so that text is easy to read
and you can differentiate between often-
confused characters, such as:
•` ' ( { [ <
• Modify screen size to maximize available
space for output
• Make sure that the screen buffer width is
smaller than window width
• Enable copy and paste
Demonstration: Configuring the console

In this demonstration, you will see how to:


• Run the 64-bit console as Administrator
• Set a font family
• Set a console layout
• Start a transcript
Configuring the ISE

• Two panes: script and console


• One-pane and two-pane view options
• Command Add-on displays available
commands
• Customization of font style, size, and color
• Customization of screen color
• Bundling of color selections into themes
• Additional features include snippets, add-
ins, and debugging
Demonstration: Configuring the ISE

In this demonstration, you will see how to:


• Run the ISE as Administrator
• Configure the pane layout
• Dock and undock the command pane
• Configure the font size
• Select a color theme
Lab A: Configuring Windows PowerShell

Exercise 1: Configuring the Windows


PowerShell console application
• Exercise 2: Configuring the Windows
PowerShell ISE application

Logon Information
Virtual machines: 10961C-LON-DC1
10961C-LON-CL1
User name: ADATUM\
Administrator
Password: Pa55w.rd
Estimated Time: 15 minutes
Lab Scenario

You are an administrator who will use


Windows PowerShell to automate many
administrative tasks. You must make sure
that you can successfully start the correct
Windows PowerShell host applications, and
configure those applications for future use
by customizing their appearance.
Lab Review

Why might you configure alternative text


colors in the ISE?
• What causes a horizontal scroll bar in the
Windows PowerShell console window?
Lesson 2: Understanding command syntax

Cmdlet structure
Parameters
Tab completion
Using Get-Help
Demonstration: Viewing help
Interpreting the help syntax
Updating help
About files
• Demonstration: Using About files
Cmdlet structure

• Verb is the action the cmdlet performs:


• Get
• Set
• New
• Add
• Remove

• Noun is the resource the cmdlet affects:


• Service
• Process
• Prefixes used to group related nouns:
• AD, SP, and AzureAD
Parameters

• Parameters modify the action of a cmdlet


• Names are entered starting with a dash (-)
• Parameters can be optional or required
• You will receive prompts for required parameters,
if needed
• Some accept multiple values, separated by
commas
• Parameter name is optional for positional
parameters
Tab completion

• Allows you to enter cmdlet, parameter,


variable, and path names more quickly and
accurately
• Helps you to discover cmdlets and
parameters
• Supports the use of wildcards
Using Get-Help

• Displays Windows PowerShell help content


• You provide a cmdlet name to display help
for a cmdlet
• Supports wildcards
• Parameters include:
• -Examples
• -Full
• -Online
• -ShowWindow
• -Parameter ParameterName
Demonstration: Viewing help

In this demonstration, you will see how to


use various options of the help system
Interpreting the help syntax

Parameter set Mandatory parameter

Positional parameter Optional parameter


Updating help

• Windows PowerShell 3.0 and newer versions


do not ship with help files
• Update-Help:
• Uses downloadable help content to update your
local help
• Checks no more than once every 24 hours by
default
• Save-Help enables you to download help
and save it to an alternate location
accessible to computers that are not
connected to the Internet
About files

• Provide documentation for global shell


techniques, concepts, and features
• Start with about_
• View list by running Get-Help about*
• You will need to read many of these files to
complete several upcoming lab exercises
Demonstration: Using About files

In this demonstration, you will see how to


use the About help file topics
Lesson 3: Finding commands

What are modules?


Demonstration: Viewing modules
Finding cmdlets
Demonstration: Searching for cmdlets
What are aliases?
Demonstration: Using aliases
• Using Show-Command
What are modules?

• Modules:
• Are containers for related cmdlets
• Are provided as part of management tools for
various software packages
• Must be loaded into current session

• Windows PowerShell version 3.0 and newer


support autoloading
• Autoloading requires Windows Server 2012/
Windows 8 or newer
Demonstration: Viewing modules

In this demonstration, you will see:


• How to find installed modules
• How autoloading and manual loading of
modules work
Finding cmdlets

• Use Get-Command and Get-Help, both of which


support wildcards
• Use –Noun, –Verb, and –Module parameters with
Get-Command
• Get-Help can also search the content of help files
if no match is found when searching command
names
• Use the PowerShellGet module to find modules
and commands from the PowerShell Gallery

You might also like