This document provides an agenda for a 10 hour PowerShell training course. The agenda covers PowerShell fundamentals like variables, data types, conditions, loops, cmdlets, functions, modules, and execution policy. It also covers more advanced topics like PowerShell remoting, working with Active Directory using PowerShell, and building PowerShell scripts. The document includes examples to illustrate various PowerShell concepts. The training will be delivered by Pardha Sai who works as an Automation Engineer.
Basic commands for powershell : Configuring Windows PowerShell and working wi...Hitesh Mohapatra
Configuring Windows PowerShell and working with basic commands
• Configuring the Windows PowerShell console
• Configuring the Windows PowerShell ISE application
• Finding commands
• Running commands
• Using the About files
Basic commands for powershell : Configuring Windows PowerShell and working wi...Hitesh Mohapatra
Configuring Windows PowerShell and working with basic commands
• Configuring the Windows PowerShell console
• Configuring the Windows PowerShell ISE application
• Finding commands
• Running commands
• Using the About files
Composition is a fundamental principle of functional programming, but how is it different from an object-oriented approach, and how do you use it in practice?
In this talk for beginners, we'll start by going over the basic concepts of functional programming, and then look at some different ways that composition can be used to build large things from small things.
After that, we'll see how composition is used in practice, beginning with a simple FizzBuzz example, and ending with a complete (object-free!) web application.
Mockito vs JMockit, battle of the mocking frameworksEndranNL
(Original keynote slides can be found at https://github.com/Endran/PublicSlides)
For years the industry standard of mocking on the JVM has been Mockito. Mockito is a wonderful library that really speeds up your testing by allowing you to create mocks in a very simple way. That being said, it does have its drawbacks, for which different strategies need to be deployed to keep your code testable. The main drawbacks are statics and finals. Final classes cannot be mocked, nor final methods, and also static methods are a no-go. To work with these type of things we need to wrap it, and copy the signature in a non final, non static way.
I have a great adversity against statics, I've devoted an entire post about it, in short; It hides dependencies and brings so little convenience at the costs of its drawbacks. Finals on the other hand have purpose, it helps messaging the goal of a class or method. Java is one of the few languages where classes and methods are open/virtual by default and have to be closed/final by explicit action. In (for example) Kotlin, everything is final by default, if you do not want something to be final, you should use the open keyword.
No matter if you follow the principle of making things final, static or not, if you are using Mockito the decision has been made. This mocking framework demands that everything is non-final, demands that everything is designed to be extended, since it might need to be mocked away. We should be able to improve upon this, and by the name of this post, you should be able to guess which framework will save the day. JMockit will help us with our impediments, and will give some other nifty benefits as well!
The lazy programmer's guide to writing thousands of testsScott Wlaschin
We are all familiar with example-based testing, as typified by TDD and BDD, where each test is hand-crafted.
But there's another approach to writing tests. In the "property-based testing" approach, a single test is run hundreds of times with randomly generated inputs. Property-based testing is a great way to find edge cases, and also helps you to understand and document the behavior of your code under all conditions.
This talk will introduce property-based testing, show you how it works, and demonstrate why you should consider adding this powerful technique to your toolbelt.
The Functional Programming Toolkit (NDC Oslo 2019)Scott Wlaschin
(slides and video at https://fsharpforfunandprofit.com/fptoolkit)
The techniques and patterns used in functional programming are very different from object-oriented programming, and when you are just starting out it can be hard to know how they all fit together.
In this big picture talk for FP beginners, I'll present some of the common tools that can be found in a functional programmer's toolbelt; tools such as "map", "apply", "bind", and "sequence". What are they? Why are they important? How are they used in practice? And how do they relate to scary sounding concepts like functors, monads, and applicatives?
PHP string function helps us to manipulate string in various ways. There are various types of string function available. Here we discuss some important functions and its use with examples.
(video and more at http://fsharpforfunandprofit.com/fppatterns)
In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID. The functional programming community has design patterns and principles as well. This talk will provide an overview of some of these patterns (such as currying, monads), and present some demonstrations of FP design in practice. We'll also look at some of the ways you can use these patterns as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
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 :-)
Towards Functional Programming through Hexagonal ArchitectureCodelyTV
Slides of for the talk "Towards Functional Programming through Hexagonal Architecture" delivered at the Software Crafters Barcelona 2018 conference #scbcn18 by Juanma Serrano from Habla Computing and Javier Ferrer from CodelyTV
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
Composition is a fundamental principle of functional programming, but how is it different from an object-oriented approach, and how do you use it in practice?
In this talk for beginners, we'll start by going over the basic concepts of functional programming, and then look at some different ways that composition can be used to build large things from small things.
After that, we'll see how composition is used in practice, beginning with a simple FizzBuzz example, and ending with a complete (object-free!) web application.
Mockito vs JMockit, battle of the mocking frameworksEndranNL
(Original keynote slides can be found at https://github.com/Endran/PublicSlides)
For years the industry standard of mocking on the JVM has been Mockito. Mockito is a wonderful library that really speeds up your testing by allowing you to create mocks in a very simple way. That being said, it does have its drawbacks, for which different strategies need to be deployed to keep your code testable. The main drawbacks are statics and finals. Final classes cannot be mocked, nor final methods, and also static methods are a no-go. To work with these type of things we need to wrap it, and copy the signature in a non final, non static way.
I have a great adversity against statics, I've devoted an entire post about it, in short; It hides dependencies and brings so little convenience at the costs of its drawbacks. Finals on the other hand have purpose, it helps messaging the goal of a class or method. Java is one of the few languages where classes and methods are open/virtual by default and have to be closed/final by explicit action. In (for example) Kotlin, everything is final by default, if you do not want something to be final, you should use the open keyword.
No matter if you follow the principle of making things final, static or not, if you are using Mockito the decision has been made. This mocking framework demands that everything is non-final, demands that everything is designed to be extended, since it might need to be mocked away. We should be able to improve upon this, and by the name of this post, you should be able to guess which framework will save the day. JMockit will help us with our impediments, and will give some other nifty benefits as well!
The lazy programmer's guide to writing thousands of testsScott Wlaschin
We are all familiar with example-based testing, as typified by TDD and BDD, where each test is hand-crafted.
But there's another approach to writing tests. In the "property-based testing" approach, a single test is run hundreds of times with randomly generated inputs. Property-based testing is a great way to find edge cases, and also helps you to understand and document the behavior of your code under all conditions.
This talk will introduce property-based testing, show you how it works, and demonstrate why you should consider adding this powerful technique to your toolbelt.
The Functional Programming Toolkit (NDC Oslo 2019)Scott Wlaschin
(slides and video at https://fsharpforfunandprofit.com/fptoolkit)
The techniques and patterns used in functional programming are very different from object-oriented programming, and when you are just starting out it can be hard to know how they all fit together.
In this big picture talk for FP beginners, I'll present some of the common tools that can be found in a functional programmer's toolbelt; tools such as "map", "apply", "bind", and "sequence". What are they? Why are they important? How are they used in practice? And how do they relate to scary sounding concepts like functors, monads, and applicatives?
PHP string function helps us to manipulate string in various ways. There are various types of string function available. Here we discuss some important functions and its use with examples.
(video and more at http://fsharpforfunandprofit.com/fppatterns)
In object-oriented development, we are all familiar with design patterns such as the Strategy pattern and Decorator pattern, and design principles such as SOLID. The functional programming community has design patterns and principles as well. This talk will provide an overview of some of these patterns (such as currying, monads), and present some demonstrations of FP design in practice. We'll also look at some of the ways you can use these patterns as part of a domain driven design process, with some simple real world examples in F#. No jargon, no maths, and no prior F# experience necessary.
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 :-)
Towards Functional Programming through Hexagonal ArchitectureCodelyTV
Slides of for the talk "Towards Functional Programming through Hexagonal Architecture" delivered at the Software Crafters Barcelona 2018 conference #scbcn18 by Juanma Serrano from Habla Computing and Javier Ferrer from CodelyTV
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
On August 24th and 25th, Chris Raschke presented on one of the most notable releases in Microsoft's new System Center 2012 lineup, Configuration Manager 2012.
Download the slide deck (PDF, 1 MB) for a sneak peek at Configuration Manager 2012, including major product themes, migration from 2007, and steps to prepare for 2012. Chris will also show you how SCCM 2012 can ease management and save you money!
For more information on this or other System Center topics, visit our blog at www.cdhtalkstech.com.
Learn About:
Newly added features such as Forefront Endpoint Protection and connectors to Intune and Azure
Support features like IOS and Linux, including extended device management
Architectural layout for design considerations, including the CAS Server and the elimination of Native Mode
New ways to configure and deploy your software updates
System Center integration and automation with other System Center products, such as Service Manager and the Data Warehouse connector
Microsoft system center 2012 r2 configuration managerapponix1
SCCM Training by Industry Expert Certified Trainers at lowest fees, World Class Online Lab access, Certification and Placement, Flexible timings, Bangalore
IT/Dev Connections: Intune, ConfigMgr, or Both: Choose the Right Tool for the...Peter Daalmans
You have well-managed systems, but demand continues to increase to manage tablets and devices. The additional manageability features of Windows 10 also add a new possibility to manage mobile devices completely on premises. When should you use Intune, Configuration Manager, or both? Join this session to learn about best practices and explore scenarios to understand the best management strategy for your enterprise.
And here is the file I have distributed to my friends of net-workers. This PDF file explains the installation of Active Directory, SQL Server 2008, SQL Server 2012 and finally the step by step installation of the System Center Configuration Manager 2012 R2. This document also describes the prerequisite configuration required for the successful completion of installation of SCCM 2012 R2.
Managing Updates with System Center Configuration Manager 2012JasonCondo
From the Dogfood Conference 2014 in Columbus Ohio (www.dogfoodcon.com). Learn how the SUP role works in ConfigMgr 2012, how to implement a security risk process and how to manage updates in ConfigMgr 2012.
Get-Help: An intro to PowerShell and how to Use it for Eviljaredhaight
This talk covers the basics of how PowerShell works and how to use it. It then goes over a lot of the interesting offensive PowerShell tools that are available and gives a demo of using PowerShell to escalate to Domain Admin privileges on a network.
A video of the talk is available here: https://www.youtube.com/watch?v=YSUJNInriiY
Supercharging WordPress Development - Wordcamp Brighton 2019Adam Tomat
Slide links:
- https://lumberjack.rareloop.com
- https://docs.lumberjack.rareloop.com
- https://github.com/Rareloop/lumberjack-bedrock-installer
- https://github.com/Rareloop/lumberjack
- https://github.com/Rareloop/lumberjack-validation
- https://github.com/Rareloop/hatchet
- rareloop.com/careers
- https://www.rareloop.com/posts/comparing-modern-mvc-wordpress-frameworks/
- https://lizkeogh.com/2017/08/31/reflecting-reality/amp
- https://www.youtube.com/watch?v=uQUxJObxTUs
- https://www.upstatement.com/timber
- https://roots.io/bedrock
---
Often WordPress themes are not easy to change, maintain or fun to work on. This can rule WordPress out as a viable option for bespoke, non-trivial websites.
In this talk we’ll dive into how this happens & look at how we can benefit from software engineering techniques to help make your code easier to change. I’ll also show how using Lumberjack, a powerful MVC framework built on Timber, can be used to power-up your themes.
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.
1. Welcome to PowerShell Training
Name : Pardha Sai (Pardhu)
Role : Automation Engineer
Course Duration : 10 Hours
2. Agenda
• What do you know about PowerShell ?
• How Powershell help’s IT ?
• Little History of Powershell
• Variables
• Data Types
• Conditions
• Loops
• What is command let ?
• How to find Cmdlets in PowerShell ?
• 3 important Cmdlets
• What is alias ?
• What is Pipeline and use of where and select object ?
• What is PowerShell profile and how it is used ?
• What is WMI Object ?
3. Agenda
• What is PowerShell Remoting and
How we can remote ?
• What is function ?
• What is module ?
• How to find and use Modules ?
• What is RSAT ?
• Client VS Server RSAT ?
• Getting Started with AD PS Module ?
• AD Module Version History
• How to import & export CSV data in PS ?
• How to Create Bulk User’s by using CSV File ?
• How to copy a user across AD?
• What is Execution Policy ?
• How to build PowerShell Script ?
4. What do you know about
PowerShell ???
How Powershell helpful to IT Administrators ???
&
5. History of powershell
Jeffrey Snover
He is a Distinguished Engineer and the Lead Architect for
the Windows Server Division at Microsoft. He is the inventor
of Windows PowerShell, an object-based distributed
automation engine, scripting language, and command line
shell.
6. Version of PowerShell
PowerShell V1.0 PowerShell V2.0 PowerShell V3.0 PowerShell V4.0 PowerShell V5.0
• Released in November
2006.
• Supports in Windows XP
SP2,Vista,2003.
• optional component of
Windows Server 2008.
• Supports in Windows 7,2008
R2.
• Also released for Windows XP
SP3,2003 SP2 and Vista SP1.
• PowerShell Remoting
• Modules Supports
• Windows PowerShell Integrated
Scripting Environment (ISE)
• Exception Handling Supports
• APIs Supports
• New Cmdlets
• Supports in Windows 8,2012.
• Also released for win 7
SP1,2008 SP1 and 2008 R2
SP1.
• Help update (Man Pages)
• Automatic module detection
• Session connectivity
• New Cmdlets and Modules
• Supports in Windows
8.1,2012 R2
• Also released for win 7
SP1,2008 R2 SP1 and 2012
R2 SP1.
• Desired State Configuration
• New Default Execution Policy
• Enhanced debugging
• workflow PowerShell
• New Cmdlets and Modules
• Supports in Windows
10,2016 and Nano server
• Also released for win 7,8,8.1
SP1,2008 R2 SP1 and 2012
R2 SP1.
• Oneget/PowerShell get
• PowerShell class definitions
(properties, methods)
• Desired State Configuration
V2.0
• New Cmdlets and Modules
@source : Wikipedia
8. Variables
Variables store information temporarily so you can take the information
contained in a variable and process it in further steps.
PowerShell creates new variables automatically so there is no need to
specifically "declare" variables. Simply assign data to a variable. The only
thing you need to know is that variable names are always prefixed with a
"$".
You can then output the variable content by entering the variable name, or
you can merge the variable content into text strings. To do that, just make
sure the string is delimited by double-quotes. Single-quoted text will not
resolve variables.
9. • Declare Variables
• Selecting Variable Names
• Assigning and Returning Values
• Using Special Variable Cmdlets
• Default Variables
Variables
11. Data Types
There is an additional and important reason to assign data types manually because every
data type has its own set of special commands. For example, a date can be stored as text in
a String data type. And that's just exactly what PowerShell does: it's not clever enough to
automatically guess that this really is a date or time:
$date = "November 12, 2004“;$date
November 12, 2004
If you store a date as String, then you'll have no access to special date functions. Only
DateTime objects make them available. So, if you're working with date and time indicators,
it's better to store them explicitly as DateTime:
[datetime]$date = "November 12, 2004" $date
Friday, November 12, 2004 00:00:00
The output of the variable will now immediately tell you the day of the week corresponding
to the date, and also enable comprehensive date and time calculation commands. That
makes it easy, for example, to find the date 60 days later:
$date.AddDays(60)
Tuesday, January 11, 2005 00:00:00
19. What is Cmdlet ?
Cmdlet Function
Get-Location get the current directory
Set-Location change the current directory
Copy-Item copy files
Remove-Item remove a file or directory
Move-Item move a file
Rename-Item rename a file
New-Item create a new empty file or directory
A cmdlet (pronounced "command-let") is a lightweight Windows PowerShell script that performs a single function.
A command, in this context, is a specific order from a user to the computer's operating system or to an application to
perform a service, such as "Show me all my files" or "Run this program for me." Although Windows PowerShell
includes more than two hundred basic core cmdlets, administrators can also write their own cmdlets and share them.
20. How to find cmdlets in PowerShell ???
The folks at Microsoft made several design strategies when
designing PowerShell cmdlets. First is the ability to easily infer cmdlet names,
or at the very least make them easy to discover. PowerShell cmdlets are also
designed to be easy to use with standardized syntax, making them easy to
use interactively from the command line or to create powerful scripts.
PowerShell cmdlets use the Verb-Noun format
Example : Cmdlet Name Verb Noun
Get-Service Get Service
Start-Service Start Service
The verb portion of the cmdlet name indicates the action to be performed on the noun.
21. Three Important Cmdlets
If you don’t remember anything else
Get-Help : PowerShell has help info backed
right in, Just like “Man” pages in Unix
Get-Member : Since PowerShell is object
aware, This cmdlet helps explore the
methods and Properties within PowerShell
Get-Command : PowerShell’s dictionary lookup, this
will help you to find cmdlets you can use
22. What is alias ???
An alias is an alternate name or nickname for a cmdlet or for a command element, such as a function, script, file, or
executable file. You can use the alias instead of the command name in any Windows PowerShell commands.
PowerShell (Cmdlet) PowerShell (Alias) CMD.EXE / COMMAND.COM Unix shell Description
Get-ChildItem gci, dir, ls dir ls
List all files / directories in the (current)
directory
Test-Connection/ping N/A ping ping
Sends ICMP echo requests to specified
machine from the current machine, or
instructs another machine to do so
Get-Content gc, type, cat type cat Get the content of a file
Get-Command gcm help type, which, compgen List available commands
Get-Help help, man help apropos, man Help on commands
Clear-Host cls, clear cls clear Clear the screen[b]
Copy-Item cpi, copy, cp copy cp
Copy one or several files / a whole
directory tree
Move-Item mi, move, mv move mv
Move a file / a directory to a new
location
Remove-Item ri, del, erase, rmdir, rd, rm del, erase, rmdir, rd rm, rmdir Delete a file / a directory
Rename-Item rni, ren, mv ren, rename mv Rename a file / a directory
Get-Location gl, cd, pwd cd pwd
Display the current directory/present
working directory.
@source : Wikipedia
23. Pipeline
You can use pipelines to send the objects that are output by one command to be used as input to
another command for processing. And you can send the output of that command to yet another
command. The result is a very powerful command chain or "pipeline" that is comprised of a series of
simple commands.
Example : Get-Process notepad | stop-process
Get-Service | Where-Object {$_.name -Match "win"}
Get-Service | Where-Object {$_.name -Match "win"} | select Name
A pipeline is a series of commands connected by pipeline operators (|) (ASCII 124) . Each pipeline operator
sends the results of the preceding command to the next command.
26. WMI
WMI represents the insides of your computer in the form of classes. WMI provides classes for nearly everything:
processor, BIOS, memory, user accounts, services, etc.
The name of a class usually consists of the "Win32" prefix.
For example, the Win32_Service describes services.
Get-WmiObject Win32_BIOS
Get-WmiObject Win32_Process -filter 'name = "powershell.exe"‘
[wmi]"Win32_Service.Name='netman'“
Get-WmiObject win32_service | Where-Object {$_.name -eq "netman"}
Get-WmiObject win32_computersystem | gm
Get-WmiObject win32_computersystem | Select-Object domain
29. Functions
Functions are self-defined new commands consisting of general
PowerShell building blocks. They have in principle three tasks:
• Shorthand: very simple shorthand for commands and immediately
give the commands arguments to take along
• Combining: functions can make your work easier by combining
several steps
• Encapsulating and extending: small but highly complex programs
consisting of many hundreds of statements and providing entirely new
functionalities
The basic structure of a function is the same in all three instances: after
the Function statement follows the name of the function, and after that
the PowerShell code in braces.
Example : Shorthand
Function myPing
{
ping localhost
}
Example : Combining
Function NextFreeDrive
{
For ($x=67; $x -le 90; $x++)
{
$driveletter =
[char]$x + ":"
If (!(Test-Path
$driveletter))
{
$driveletter
break
}
}
}
31. Modules
A module is a package that contains Windows PowerShell commands, such
as cmdlets, providers, functions, workflows, variables, and aliases.
People who write commands can use modules to organize their commands
and share them with others. People who receive modules can add the
commands in the modules to their Windows PowerShell sessions and use
them just like the built-in commands.
BUILT-IN MODULES :
Microsoft.PowerShell.Core
Microsoft.PowerShell.Diagnostics
Microsoft.PowerShell.Host
Microsoft.PowerShell.Management
Microsoft.PowerShell.Security
Microsoft.PowerShell.Utility
Microsoft.WSMan.Management
PSScheduledJob
PSWorkflow
PSWorkflowUtility
HOW TO USE A MODULE
To use a module, perform the following tasks:
1. Install/Import the module. (This is often done for you.)
2. Find the commands that the module added.
3. Use the commands that the module added.
33. RSAT (Remote Server Administration Tools)
RSAT (Remote Server Administration Tools) is a Windows
Server component for remote management of other
computers also running that operating system. RSAT was
introduced in Windows Server 2008 R2.
RSAT allows administrators to run snap-ins and tools on a
remote computer to manage features, roles and role
services. The software includes tools for cluster-aware
updating, Group Policy management and Hyper-V
management, as well as the Best Practices Analyzer.
RSAT runs on Windows 7, Windows 8, Windows Server
2008, Windows Server 2008 R2 and Windows Server 2012.
34. Client RSAT AD VS Server RSAT AD
Client
Windows 7
Windows Server 2008 R2
Windows 8
Windows Server 2012
Windows 8.1
Windows Server 2012 R2
Server
Windows Server 2003 or 2008
AD Management Gateway Service
Windows Server 2008 R2
Windows Server 2012
Windows Server 2012 R2
Port
9389
AD
Cmdlet
Feature
Level
39. Copy-aduser
* Import the Copy-aduser Function in PowerShell Console
* Once Copy-aduser Function Loaded type below command to Execute it
Example : copy-aduser -fristName "PowerShell" -LastName "Trainer" -userLogonName
"Powershell" -SampleUserName "Pardhu" -password "Test@123"
Function is placed in
below txt file
41. Execution Policy
• Restricted
• AllSigned
• RemoteSigned
• Unrestricted
• Bypass
• Undefined
Windows PowerShell execution policies let you determine the
conditions under which Windows PowerShell loads configuration
files and runs scripts.
You can set an execution policy for the local computer, for the
current user, or for a particular session. You can also use a Group
Policy setting to set execution policy for computers and users.
Execution policies for the local computer and current user are stored
in the registry. You do not need to set execution policies in your
Windows PowerShell profile. The execution policy for a particular
session is stored only in memory and is lost when the session is
closed.
43. Thank You
To Learn Powershell you have use it more
Here are Some reference Links :
To Learn More : Use Microsoft Virtual Academy
For Practice : Use Microsoft Virtual Labs
For Cmdlets : Use TechNet
Keep up-to-date : Use https://powershell.org/
Name : Pardha Sai (Pardhu)
Role : Automation Engineer
Phone : 9885572999
Email ID : Pardhasai.Vadlamudi@in.fujitsu.com
Editor's Notes
In Slide Show mode, click the arrow to enter the PowerPoint Getting Started Center.