This document provides an overview of the PowerShell 101 course, which introduces PowerShell's key components and language features. The course covers what PowerShell is, its core components like cmdlets, objects, and the pipeline. It also explores PowerShell's scripting language, including variables, data types, arrays, and hash tables. The goal is to teach attendees enough about PowerShell to begin writing scripts and taking advantage of its capabilities for automating IT tasks.
Talks about PowerShell UIAutomation used by Y Soft for automating GUI Windows installer testing in multiple languages. How to integrate PowerShell with continuous integration system Jenkins.
In this presentation, I give an introduction to Windows PowerShell:
- What is it, and how does it work?
- How can you extend it to provide support for administering your own product or project?
NOTES:
1) Some of the text in this presentation is a little small for reading in a 400 pixel flash viewer. I'd recommend downloading the presentation instead.
2) The slides might not make sense without the notes that go with them. I've added the notes as comments to each slide. They still might not make much sense, but that's a different problem :-)
This lecture discusses the concept of Regular Expressions along with its usage in different tools such as grep, sed, and awk
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
Talks about PowerShell UIAutomation used by Y Soft for automating GUI Windows installer testing in multiple languages. How to integrate PowerShell with continuous integration system Jenkins.
In this presentation, I give an introduction to Windows PowerShell:
- What is it, and how does it work?
- How can you extend it to provide support for administering your own product or project?
NOTES:
1) Some of the text in this presentation is a little small for reading in a 400 pixel flash viewer. I'd recommend downloading the presentation instead.
2) The slides might not make sense without the notes that go with them. I've added the notes as comments to each slide. They still might not make much sense, but that's a different problem :-)
This lecture discusses the concept of Regular Expressions along with its usage in different tools such as grep, sed, and awk
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
This lecture discusses a group of Utilities and Commands that will be used in the following lectures and are very useful for CLI Users and Bash Script Programmers
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
This lecture discusses the concept of Multi-User support in Linux. It discusses how Linux protects user files and resources from other user unauthorized access. It also shows how to share resources and files among users, how to add/del users and groups.
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
This lecture describes the virtual filesystems procfs and sysfs.
Video for this Lecture on youtube:
http://www.youtube.com/watch?v=wlxL-iQN6No
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
Ahmed ElArabawy
- https://www.linkedin.com/in/ahmedelarabawy
Docker is the world's leading software containerization platform.
This is a comprehensive introduction to Docker, suitable for delivering in introductory meetups to an audience who does not know about docker.
In case you want to deliver this presentation somewhere, kindly drop me a mail at aditya.konarde@gmail.com
You can contact me at:
Connect with me onLinkedIN: https://www.linkedin.com/in/adityakonarde
Add me on Facebook: https://www.facebook.com/Aditya.Konarde
Tweet to me @aditya_konarde
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Simplilearn
This presentation on Chef will help you understand why Chef is needed, what is Chef, what is configuration management, infrastructure as code, components of Chef, Chef architecture & how it works, and you will also see a demo on Chef. Chef is an open source tool developed by Opscode. It is written in Ruby and Erlang. It automates the configuration and maintenance of multiple servers. Configuration management is a collection of engineering practices that provides a systematic way to manage entities for efficient deployment. These entities include code, infrastructure and people. Now let us get started and understand Chef in detail.
Below topics are explained in this Chef presentation:
1. Why Chef?
2. What is Chef?
3. Configuration management
4. Infrastructure as code
5. Components of Chef
6. Chef architecture
7. Flavors of Chef
8. Chef demo
Simplilearn's DevOps Certification Training Course will prepare you for a career in DevOps, the fast-growing field that bridges the gap between software developers and operations. You’ll become en expert in the principles of continuous development and deployment, automation of configuration management, inter-team collaboration and IT service agility, using modern DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios. DevOps jobs are highly paid and in great demand, so start on your path today.
Why learn DevOps?
Simplilearn’s DevOps training course is designed to help you become a DevOps practitioner and apply the latest in DevOps methodology to automate your software development lifecycle right out of the class. You will master configuration management; continuous integration deployment, delivery and monitoring using DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios in a practical, hands-on and interactive approach. The DevOps training course focuses heavily on the use of Docker containers, a technology that is revolutionizing the way apps are deployed in the cloud today and is a critical skillset to master in the cloud age.
Who should take this course?
DevOps career opportunities are thriving worldwide. DevOps was featured as one of the 11 best jobs in America for 2017, according to CBS News, and data from Payscale.com shows that DevOps Managers earn as much as $122,234 per year, with DevOps engineers making as much as $151,461. DevOps jobs are the third-highest tech role ranked by employer demand on Indeed.com but have the second-highest talent deficit.
1. This DevOps training course will be of benefit the following professional roles:
2. Software Developers
3. Technical Project Managers
4. Architects
5. Operations Support
6. Deployment engineers
7. IT managers
8. Development managers
Learn more at: https://www.simplilearn.com/
While many organizations have started to automate their software development processes, many still engineer their infrastructure largely by hand. Treating your infrastructure just like any other piece of code creates a “programmable infrastructure” that allows you to take full advantage of the scalability and reliability of the AWS cloud. This session will walk through practical examples of how AWS customers have merged infrastructure configuration with application code to create application-specific infrastructure and a truly unified development lifecycle. You will learn how AWS customers have leveraged tools like CloudFormation, orchestration engines, and source control systems to enable their applications to take full advantage of the scalability and reliability of the AWS cloud, create self-reliant applications, and easily recover when things go seriously wrong with their infrastructure.
Starting with Docker 1.12, Docker has added features to the core Docker Engine to make multi-host and multi-container orchestration extremely simple to use and accessible to everyone. Docker 1.12 Networking plays a key role in enabling these orchestration features.
In this online meetup, we learned all the new and exciting networking features introduced in Docker 1.12:
Swarm-mode networking
Routing Mesh
Ingress and Internal Load-Balancing
Service Discovery
Encrypted Network Control-Plane and Data-Plane
Multi-host networking without external KV-Store
MACVLAN Driver
This presentation covers deploy Azure DevOps projects, repositories, pipelines, variable groups, etc. using the newly released Azure DevOps Terraform provider.
A recording of this presentation is available on my YouTube channel here: https://www.youtube.com/c/adinermie
A blog article about this topic is also available here: https://adinermie.com/deploying-azure-devops-ado-using-terraform/
Packer and TerraForm are fundamental components of Infrastructure as Code. I recently gave a talk at a DevOps meetup, which allowed me the opportunity to discuss the basics of these two tools, and how DevOps teams should be using them
You'll understand how hackers can attack resources hosted in the Azure and protect Azure infrastructure by identifying vulnerabilities, along with extending your pentesting tools and capabilities.
This lecture is an overview for the topics that will be covered in the course along with some course logistics
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
ITPROceed 2016 - The Art of PowerShell ToolmakingKurt Roggen [BE]
Learn some best pratices and guidelines on building your own PowerShell toolset. Also discover some of the best kept secrets and how you can benefit from them.
This lecture discusses a group of Utilities and Commands that will be used in the following lectures and are very useful for CLI Users and Bash Script Programmers
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
This lecture discusses the concept of Multi-User support in Linux. It discusses how Linux protects user files and resources from other user unauthorized access. It also shows how to share resources and files among users, how to add/del users and groups.
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
This lecture describes the virtual filesystems procfs and sysfs.
Video for this Lecture on youtube:
http://www.youtube.com/watch?v=wlxL-iQN6No
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
Ahmed ElArabawy
- https://www.linkedin.com/in/ahmedelarabawy
Docker is the world's leading software containerization platform.
This is a comprehensive introduction to Docker, suitable for delivering in introductory meetups to an audience who does not know about docker.
In case you want to deliver this presentation somewhere, kindly drop me a mail at aditya.konarde@gmail.com
You can contact me at:
Connect with me onLinkedIN: https://www.linkedin.com/in/adityakonarde
Add me on Facebook: https://www.facebook.com/Aditya.Konarde
Tweet to me @aditya_konarde
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Simplilearn
This presentation on Chef will help you understand why Chef is needed, what is Chef, what is configuration management, infrastructure as code, components of Chef, Chef architecture & how it works, and you will also see a demo on Chef. Chef is an open source tool developed by Opscode. It is written in Ruby and Erlang. It automates the configuration and maintenance of multiple servers. Configuration management is a collection of engineering practices that provides a systematic way to manage entities for efficient deployment. These entities include code, infrastructure and people. Now let us get started and understand Chef in detail.
Below topics are explained in this Chef presentation:
1. Why Chef?
2. What is Chef?
3. Configuration management
4. Infrastructure as code
5. Components of Chef
6. Chef architecture
7. Flavors of Chef
8. Chef demo
Simplilearn's DevOps Certification Training Course will prepare you for a career in DevOps, the fast-growing field that bridges the gap between software developers and operations. You’ll become en expert in the principles of continuous development and deployment, automation of configuration management, inter-team collaboration and IT service agility, using modern DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios. DevOps jobs are highly paid and in great demand, so start on your path today.
Why learn DevOps?
Simplilearn’s DevOps training course is designed to help you become a DevOps practitioner and apply the latest in DevOps methodology to automate your software development lifecycle right out of the class. You will master configuration management; continuous integration deployment, delivery and monitoring using DevOps tools such as Git, Docker, Jenkins, Puppet and Nagios in a practical, hands-on and interactive approach. The DevOps training course focuses heavily on the use of Docker containers, a technology that is revolutionizing the way apps are deployed in the cloud today and is a critical skillset to master in the cloud age.
Who should take this course?
DevOps career opportunities are thriving worldwide. DevOps was featured as one of the 11 best jobs in America for 2017, according to CBS News, and data from Payscale.com shows that DevOps Managers earn as much as $122,234 per year, with DevOps engineers making as much as $151,461. DevOps jobs are the third-highest tech role ranked by employer demand on Indeed.com but have the second-highest talent deficit.
1. This DevOps training course will be of benefit the following professional roles:
2. Software Developers
3. Technical Project Managers
4. Architects
5. Operations Support
6. Deployment engineers
7. IT managers
8. Development managers
Learn more at: https://www.simplilearn.com/
While many organizations have started to automate their software development processes, many still engineer their infrastructure largely by hand. Treating your infrastructure just like any other piece of code creates a “programmable infrastructure” that allows you to take full advantage of the scalability and reliability of the AWS cloud. This session will walk through practical examples of how AWS customers have merged infrastructure configuration with application code to create application-specific infrastructure and a truly unified development lifecycle. You will learn how AWS customers have leveraged tools like CloudFormation, orchestration engines, and source control systems to enable their applications to take full advantage of the scalability and reliability of the AWS cloud, create self-reliant applications, and easily recover when things go seriously wrong with their infrastructure.
Starting with Docker 1.12, Docker has added features to the core Docker Engine to make multi-host and multi-container orchestration extremely simple to use and accessible to everyone. Docker 1.12 Networking plays a key role in enabling these orchestration features.
In this online meetup, we learned all the new and exciting networking features introduced in Docker 1.12:
Swarm-mode networking
Routing Mesh
Ingress and Internal Load-Balancing
Service Discovery
Encrypted Network Control-Plane and Data-Plane
Multi-host networking without external KV-Store
MACVLAN Driver
This presentation covers deploy Azure DevOps projects, repositories, pipelines, variable groups, etc. using the newly released Azure DevOps Terraform provider.
A recording of this presentation is available on my YouTube channel here: https://www.youtube.com/c/adinermie
A blog article about this topic is also available here: https://adinermie.com/deploying-azure-devops-ado-using-terraform/
Packer and TerraForm are fundamental components of Infrastructure as Code. I recently gave a talk at a DevOps meetup, which allowed me the opportunity to discuss the basics of these two tools, and how DevOps teams should be using them
You'll understand how hackers can attack resources hosted in the Azure and protect Azure infrastructure by identifying vulnerabilities, along with extending your pentesting tools and capabilities.
This lecture is an overview for the topics that will be covered in the course along with some course logistics
Check the other Lectures and courses in
http://Linux4EnbeddedSystems.com
or Follow our Facebook Group at
- Facebook: @LinuxforEmbeddedSystems
Lecturer Profile:
- https://www.linkedin.com/in/ahmedelarabawy
ITPROceed 2016 - The Art of PowerShell ToolmakingKurt Roggen [BE]
Learn some best pratices and guidelines on building your own PowerShell toolset. Also discover some of the best kept secrets and how you can benefit from them.
Professional Help for PowerShell ModulesJune Blender
Slides from talk at PowerShell Conference Europe 2016 (@PSConfEu). In this deck:
-- Why write PowerShell help?
-- How help for modules differs from cmdlet help
-- Mechanics:
---- Comment-based help vs. XML help
---- About topic format requirements and best practices
-- About Help Content
---- How to start an About topic
---- How to organize an About topic.
---- About topic checklist
-- How to support online help
This is an end-to-end introduction to PowerShell, as an interactive shell but more as a scripting language. From the perspective of a full-stack developer, this presentation covers the basics and six of the common issues that occasional users run into.
Bringing Home The Bacon With PowerShell - Why PowerShell Matters to IT Pros.
This talk looked at the basics of PowerShell, and what it contains and examines why it is important to IT Pros. There was also a short demo.
SenchaCon 2016: Modernizing the Ext JS Class System - Don GriffinSencha
JavaScript is advancing and ES2015 (formerly ES6) is the foundation of its future. Sencha is committed to delivering cutting-edge technology for your applications, and supporting the evolution of JavaScript is a central part of that commitment. The expansive feature set of ES2015 formally enables coding paradigms: modules to better organize your code, classes to cleanly declare reusable units of functionality, and so much more. See how Ext JS is embracing these new language and toolset features, and how they will expand your development horizons.
Python and Oracle : allies for best of data managementLaurent Leturgez
In this presentation, I described Python and how Python can Interact with Oracle database, and Oracle Cloud Infrastructure in various project : from data visualisation to data science.
https://www.globalknowledge.com/us-en/training/course-catalog/brands/microsoft/
Slide deck from Jared Thibodeau’s webinar "Taking Advantage of Microsoft PowerShell”. IT administration tasks have usually required manual, point and click operations. Those days are gone; not only is manual action no longer necessary, but your IT technologists can’t afford the time to manually do what can be easily automated and taken off their plate. PowerShell provides an intuitive way to turn time-consuming grunt work into simple, repeatable, scriptable commands. The webinar covered what you can administer with PowerShell, executing and combining multiple PowerShell commands, ways to format report information, how to perform actions on remote computers using PowerShell.
https://www.globalknowledge.com/us-en/training/course-catalog/brands/microsoft/
Learn Powershell Scripting Tutorial Full Course 1dollarcart.com.pdfClapperboardCinemaPV
https://www.news.itentertainment.org/learn-powershell-scripting-tutorial-full-course
powershell scripting tutorial in hindi
useful powershell scripts
powershell projects for beginners
best way to learn powershell
This is a slide deck from a web cast I gave 2012. It looks at how you can do cool formatting things in PowerShell. Aimed at PowerShell v2, but everything there works in V3.
Top 10 PowerShell Features in Server 2012Thomas Lee
This is from a webcast I did in September 2012 for Idera.
It looks at 10 of the cooler PowerShell V3 features of Server 2012. It is a quick look at some of the cooler features and how you can leverage PowerShell v3.
A talk to the MCT Day Zero. It covers some of the things that can go wrong in the life of a trainer and some things you can do to mitigate the problems!
2. Course Overview
1. What IS PowerShell?
2. What are Cmdlets, Objects and The Pipeline?
3. Introducing the PowerShell Language
4. Installing and using PowerShell
5. Configuring your environment with profiles
PowerShell 101
3. 1. What is PowerShell?
2. PowerShell Architecture
3. Core PowerShell Components
1. What is
PowerShell?
PowerShell 101
4. • Microsoft’s Strategic Task Automation Platform for IT
Professionals
• Shell – think Unix like
• Scripting Language – power of Perl/Ruby
• Extensible – bring on the community
• Built on .NET and Windows – MS-centric
1. What is
PowerShell?
1.1 What Is PowerShell?
PowerShell 101
5. 1. What is
PowerShell?
1.1 PowerShell Architecture
PowerShell 101
6. 1. What is
PowerShell?
1.1 PowerShell Architecture With Remoting
PowerShell 101
7. 1. What is
PowerShell?
1.2 PowerShell Components
Cmdlets Objects Pipeline
PowerShell 101
8. 1. What are Cmdlets?
2. What are Objects?
3. What is the Pipeline
4. Discovery and The Community
5. Why Does this Design Matter?
2. Cmdlets,
Objects, and
the Pipeline
PowerShell 101
9. • A unit of functionality – a mini-program that does something useful
• Implemented as a .NET Class
• Get some with PowerShell or with applications and Windows
roles/feature, buy some commercial Cmdlets, find some on the
internet, or build your own!
• Cmdlets can have aliases
• Built in or add your own
• Aliases do NOT include parameter aliasing
• Cmdlets take parameters
• Parameters have names (prefaced with “-”)
• Parameter names can be abbreviated and sometimes omitted
2. Cmdlets,
Objects, and
the Pipeline
2.1 What Are Cmdlets?
PowerShell 101
10. • Cmdlets are named with Verb-Noun syntax
Noun always singular
Sometimes Verb-PrefixNoun
• Examples
Get-Process
Get-AdUser
• Discovering cmdlet names and usage is easy
Get-Help
Get-Command
• You can use Get-Verb to get all the verbs
2. Cmdlets,
Objects, and
the Pipeline
2.1 Cmdlet Naming
PowerShell 101
11. • Basic form
CmdetName -Parametername ParameterValue …
Get-Process –Name notepad
• Parameters can be abbreviated or omitted
Get-Process –Na notepad
Get-Process notepad
• Parameter values can include Wildcards (aka ‘globbing’)
Get-Process –Name power*
• See help text for details of parameters
2. Cmdlets,
Objects, and
the Pipeline
2.1 Calling Cmdlets
PowerShell 101
12. • A computer abstraction of a real life thing
A process
A server
An AD User
• Objects have occurrences you manage
The processes running on a computer
The users in an OU
The files in a folder
• Objects dramatically simplifies scripting
2. Cmdlets,
Objects, and
the Pipeline
2.2 What are Objects?
PowerShell 101
13. • Everything in PowerShell is an object
• Cmdlets produce and consume objects
Eg Get-Process produces System.Diagnostics.Process
• You can use Get-Member to tell you the object type
• Refer to MSDN for more detail (in most cases!)
2. Cmdlets,
Objects, and
the Pipeline
2.2 Objects in PowerShell
PowerShell 101
14. • PowerShell supports:
.NET objects
COM objects
WMI objects
Custom Objects
• Syntax and usage vary
So similar, yet so different
2. Cmdlets,
Objects, and
the Pipeline
2.2 PowerShell Object Support
PowerShell 101
15. • The pipeline connects cmdlets
One cmdlet outputs objects
Next cmdlet uses those objects as input
Get-Process | Sort-Object Name
• Pipeline is not a new concept
Came From Unix/Linux
PowerShell Pipes objects not text
• The Pipeline provides rich functionality and convenience
But there can be a performance hit
2. Cmdlets,
Objects, and
the Pipeline
2.3 The Pipeline
PowerShell 101
16. • Discovery means using the product to find out more about the
product
How easy is it to discover what you need to know?
Discovery is a key attribute of PowerShell
• Discovery includes
• Predictable command names (standard verbs, and nouns)
• Consistent parameter usage
• Consistent output (objects vs text)
• Built-in help (Get-Help, Get-Command)
• Online help (Get-Help Get-Process –Online)
• Discovery leverages what you know
• Discovery is something all PowerShell users depend on!
2. Cmdlets,
Objects, and
the Pipeline
2.4 Discovery And The Community
PowerShell 101
17. • You never walk alone
• HUGE PowerShell ecosystem
Other PowerShell Users
Product team
Vendors
MVPs
• Various ways to engage with the community
• SpiceWorks
• Twitter
• PowerShell.Com
• Microsoft Forums
• Etc, etc, etc
2. Cmdlets,
Objects, and
the Pipeline
2.4 The PowerShell Community
PowerShell 101
18. • Simple to use
Far easier to compose
• Powerful in operation
PowerShell (and .NET) do the heavy lifting
• Helps to integrates functionality stacks
Operating System
Application (Microsoft and others)
PowerShell Base
Community efforts
• The IT Industry is embracing PowerShell
Cisco, Vmware, EMC, etc all support PowerShell cmdlets
2. Cmdlets,
Objects, and
the Pipeline
2.5 Why Does This Design Matter?
PowerShell 101
19. • PowerShell is an IT Professional tool to help you manage Windows
and some non-windows systems
• PowerShell’s key components include Cmdlets, Objects, and The
Pipeline
• This approach has become mainstream both within Microsoft and
with the wider IT eco-system
2. Cmdlets,
Objects, and
the Pipeline
Module Summary
PowerShell 101
20. 1. Introducing the PowerShell Language
2. Variables and Operators
3. Scalars (numbers and strings)
4. Arrays
5. Hash tables
6. Variable types
7. Other language features
3. The
PowerShell
Language
PowerShell 101
21. • The PowerShell language is derivative – some parts coming from:
• Linux and Unix shells
• Windows CMD.EXE based applications
• C#
• DEC DCL
• Perl
• And others!
• You need to know the language before you can write scripts
• Learning is underpinned by Discovery
3. The
PowerShell
Language
3.1 Introducing the PowerShell Language
PowerShell 101
22. • Variables contain objects during a session
• Variables named starting with ‘$’
$myvariable = 42
• Variable’s Type is implied (or explicit)
$myfoo = ls c:foo
• Variables can put objects into pipeline
$myfoo | Format-Table name
• Variables can be reflected on
$myfoo | Get-Member
3. The
PowerShell
Language
3.2 Variables
PowerShell 101
23. • Some variables come with PowerShell
$PSVersionTable
$PSHome
• Some variables tell PowerShell what to do
$WarningPreference
$MaximumHistoryCount
• You can create variables in Profile(s) that persist
• See variables by:
Get-ChildItem Variable:*
3. The
PowerShell
Language
3.2 Built-in Variables
PowerShell 101
24. • Scalar variable contains a single value
$i=42
• Can use value directly
$i=42; $i
• Often used to calculate a value used for output
$count = (Get-ChildItem –File C:Foo).count
"You have {0:n0} files in C:Foo" –f $count
3. The
PowerShell
Language
3.3 Scalars
PowerShell 101
25. • Numbers can be integer or [int]
• Numbers can be floating point/decimal [double]
• PowerShell can convert between number and string
$i = 10 + '10'
$i #what is $I
• But sometimes the conversion is not obvious
• $i = '123' + 10
• $i #what is $I now
3. The
PowerShell
Language
3.3 Numbers and Number Conversion
PowerShell 101
26. • You can express strings with single quotes ' or double quotes "
$string1 = 'have a nice day'
$string2 = "have a nice day"
• Double quoted strings supports substitution
$i = 42
"the value of is $i"
• Scalar only gotcha
$s = ls c:foo -file
"There are $s.count files in c:foo"
3. The
PowerShell
Language
3.3 Strings
PowerShell 101
27. • Array variables contain multiple values
• Array members addressed with [], e.g. $a[0]
$a[0] is first
$a[-1] is last
Use .GetType() to get type of an array
$myfoo = LS c:foo
$myfoo.gettype()
3. The
PowerShell
Language
3.4 Arrays
PowerShell 101
28. • Arrays can be one type, multiple types
$array = 1,
'hello',[system.guid]::newguid()
$array | Get-Member
• You typically use loop constructs to process an array
3. The
PowerShell
Language
3.4 More on Arrays
PowerShell 101
29. • Special type of an array
Also known as dictionary or property bag
• Contains a set of key/value pairs
Values can be read automagically
$ht=@{"singer"="Jerry Garcia“;
"band"="Greatful Dead”}
$ht.singer
• Value can be another hash table!
• Hash tables are used throughout PowerShell
• For more details see Get-Help about_hash_tables
3. The
PowerShell
Language
3.5 Hash Tables
PowerShell 101
30. • Variables can be implicitly typed
PowerShell works it out by default
$I=42;$i.gettype()
• Variables can be explicitly typed
[system.int64] $i = 42; $i.gettype()
• Typing an expression
$i = [int64] (55 – 13); $i.gettype()
$i = [int64] 55 – [int32] 13;
$i.gettype()
$i = [int32] 55 – [int64] 13;
$i.gettype()
3. The
PowerShell
Language
3.6 Variable Type
PowerShell 101
31. • To specify type use [<type name>] before variable name
[System.Int64] $i = 42
• Type accelerators
Synthetic types created by PowerShell
Exist for .NET and WMI objects
WMI covered more in module 8
Translated transparently
[int] translated into [system.int32]
• Usie type accelerators as if they were real .NET types
[int64] $i = 42
3. The
PowerShell
Language
3.6 Types and Type Accellerators
PowerShell 101
33. • Operators
• Expressions
• Wild Cards
• Regular Expressions
• Case sensitivity – or not
• You have to know the language to write scripts
• More details of the scripting language are in separate course(s)
3. The
PowerShell
Language
3.7 More PowerShell Language Features
PowerShell 101
34. • We looked at the PowerShell Language in overview and saw
Introducing the PowerShell Language
Variables and Operators
Scalars (numbers and strings)
Arrays
Hash tables
Variable types
Other language features
• There is more to the PowerShell language – but outside the scope of
this course
3. The
PowerShell
Language
Module Summary
PowerShell 101
36. • Installation is a bit of a variable feast
• Installation depends on the OS
• PowerShell is built into Win 8, Server 2012 R2 and later
• So nothing to install for these OSs
• Earlier versions vary
Different versions of PowerShell are supported on different
versions of Windows
With Server 2008 for example, PowerShell was an optional feature
RTFM Carefully
• Version 5 is available either as part of Win 10 pre-release or as a
separate download for Windows 8.x/Server 2012 R2
• Beware of search engine links to beta versions
4. Installing
and using
PowerShell
4.1 Installing PowerShell
PowerShell 101
37. • From the Windows client/server Start screen
Windows Server has a PowerShell icon on the start bar
Or type PowerShell from the Start Screen
• From the Windows Desktop
Create an icon on the desktop or start screen if using Windows 8.x
or later as an alternative to having it on the Start bar
• PowerShell can also be p-art of an application
GUI layered on PowerShell (eg Exchange Management Console)
An application that makes use of PowerShell (eg Server Mangager
in Server 2012 R2)
• Third Party IDEs
PowerShell Plus
Sapien PowerShell Studio
PowerGUI
4. Installing
and using
PowerShell
4.2 Using PowerShell
PowerShell 101
38. • Using PowerShell can be as simple as using the application
• Using Server Manager to install a new feature on windows
• Using Exchange Management Shell to creat a new mailbox
• But for most IT Pros using PowerShell means writing scripts that
automate your IT environment
• That means writing scripts that utilise objects relevant to your
needs (files, computers, AD components etc.)
• More about those aspects of PowerShell in a more detailed
PowerShell course
4. Installing
and using
PowerShell
4.2 Using PowerShell
PowerShell 101
39. • Installing PowerShell is, increasingly, something you do not need
to do as it’s already installed
• You can use PowerShell in a variety of ways
• From the command line or the ISE (Interactive Scripting
Environment)
• From within third party tools (eg PowerGUI)
• From withing an application that makes use of PowerShell
under the covers (e.g. Server Manager in Server 2012 R2 and
later).
4. Installing
and using
PowerShell
Module Summary
PowerShell 101
40. 1. What is a profile?
2. Why do you use Profiles?
3. What can you put into your profile?
5. Configuring
PowerShell
With Profiles
PowerShell 101
41. • Special scripts that run at startup
• Each System has 4 Profiles
• Per User for a single PowerShell host (e.g. the ISE)
• For ALL users for a single PowerShell host
• Per user for all PowerShell hosts
• For all users for all PowerShell hosts
• Profiles allow you to leverage other people’s work and to change
PowerShell to work like you want
5. Configuring
PowerShell
with Profiles
5.1 What is a profile?
PowerShell 101
42. • You have 4 as follows:
$profile | Get-Member *Host* |
Format-List name,definition
• Most users just use CurrentuserCurrentHost
$Profile variable points to that file
5. Configuring
PowerShell
with Profiles
5.1 Where do Profiles Live?
PowerShell 101
43. • Profiles are just .ps1 files that run when PowerShell/ISE start
• You can use the ISE or Notepad to edit them
• You do not need to use ALL 4 profile – just use $profile inside the
host
5. Configuring
PowerShell
with Profiles
5.1 Managing your Profiles
PowerShell 101
44. • CurrentUserThisHost profile easiest to manage
• Built in $profile variable points directly to that file
• Does it exist?
Test-Path $profile
• Create it if not
New-item –path $profile –itemtype file -Force
• Edit it in notepad/ISE
Notepad $profile
PSEDIT $profile # in ISE only!
Other Profiles
Create variable in profile to point to them
Edit vs. copy
5. Configuring
PowerShell
with Profiles
5.1 What is a profile?
PowerShell 101
45. • Profiles configure your environment as you need it
• Profiles help to make PowerShell easier for YOU to use
• You can share profiles to simplify things
For example AllUsersAllShell profile holds corporate aliases
• Be careful to avoid your profile files being overly long
5. Configuring
PowerShell
with Profiles
5.2 Why do you use Profiles?
PowerShell 101
46. • Lots of things including:
Create new variables holding useful things
Create new Provider drives giving you shortcuts to common places
including in the registry, the file system, AD, etc
Setting up your PowerShell Prompt
Adding menus to the ISE
Adding functions (or script cmdlets) that you commonly use
5. Configuring
PowerShell
with Profiles
5.3 What Can You Put Into a Profile?
PowerShell 101
47. • Installing PowerShell is, increasingly, something you do not need
to do as it’s already installed
• You can use PowerShell in a variety of ways
• From the command line or the ISE (Interactive Scripting
Environment)
• From within third party tools (eg PowerGUI)
• From within an application that makes use of PowerShell
under the covers (e.g. Server Manager in Server 2012 R2 and
later).
5.
Configuring
PowerShell
with Profiles
Module Summary
PowerShell 101
48. Course Summary
• In this course we looked at:
What IS PowerShell?
What are Cmdlets, Objects and the Pipeline?
An brief overview to the PowerShell Language
How you install and use PowerShell
Configuring PowerShell with profile files
PowerShell 101
49. Thank You For Watching
Plataan
online & classroom training: www.plataan.be
www.facebook.com/PlataanAlumni
@PlataanAlumni
http://www.linkedin.com/company/plataan
Plataan App for Windows Phone and iPhone