Upload
others
View
7
Download
0
Embed Size (px)
Citation preview
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF
HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
[email protected] MSUGSManuel Meyer, Trivadis AG
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF
HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
[email protected] MSUGSManuel Meyer, Trivadis AG
Agenda
Powershell@MSUGS3
1. Basic PSKey FeaturesMy First Script
2. Advanced PSWMI / COM / .NET
3. PS IntegrationWindows / IIS / SQL Server / TFS / Azure / Sharepoint
4. Real Life PowershellTurtle, PSI, System Checker.
Powershell@MSUGS4
Powershell Basics
Key Features
Powershell@MSUGS5
Automation
PS Remoting
PS Workflow
.NET, COM, WMI, Perfcounters, EventLog, etc.
Integration in Products
–Windows, IIS, SQL Server, TFS, Microsoft Azure, Sharepoint.
The Shell
Powershell@MSUGS6
Powershell.exe
ISE
Basics
Powershell@MSUGS7
Verb-Noun Commandlets
Get-ProcessGet-NetFirewallProfile
Set-AclSet-AuthenticodeSignature
Add-PhysicalDiskRemove-BitLockerKeyProtector
Show-EventLog
Basics
Powershell@MSUGS8
Help
Objects
Pipelining
Output
More Basics
Powershell@MSUGS9
Comparison: -eq, -ne, -lt, -gt, -le, -ge, -contains, -notcontains
Arrays, HashTables
If-else, switch
For, foreach, while, do-while
Functions
Bezeichnung Präsentation10
Advanced Powershell
Basics: Providers
Powershell@MSUGS11
Get-PSProviders
–Environment
–FileSystem
–Function
–Registry
–Certificate
Windows Management Instrumentation
(WMI)
Powershell@MSUGS12
“…a set of extensions to the Windows Driver Model that
provides an operating systeminterface…”
COM Interop
Powershell@MSUGS13
Speech
Outlook.com Login
Excel Interop
.NET
Powershell@MSUGS14
Acess any class from .NET
Load Assembly and Show UI
WPF Samples
Web Services
PS Workflows
Powershell@MSUGS15
Based on .NET Workflow Foundation
Long-running, persistable
Interrupt, suspend, resume
Sequence, Parallel, Foreach, etc…
Powershell@MSUGS16
PS Integration
Working with Windows
17
Roles & Features
Get-WindowsFeature/Install-WindowsFeature/Uninstall-WindowsFeature
Install-WindowsFeature Web-Server-IncludeAllSubFeature -IncludeManagementTools
'WebSrv01', 'WebSrv02', 'WebSrv03'| ForEach-Object{Install-WindowsFeature Web-Server-IncludeAllSubFeature -IncludeManagementTools -ComputerName $_}
Working with Windows
18
Install-WindowsFeature-ConfigurationFilePathd:\WebServerConfigFile.xml
Working with IIS
Powershell@MSUGS19
Import-Module WebAdministration
Add, change, remove
–Application pools
–Web Sites
–Virtual Directories
–Web Applications
–Website Bindings
Backup & Restore
–Web Configuration
Working with SQL Server
Powershell@MSUGS20
Import-Module SQLPS or launch fromSSMS
Execute T-SQL
Backup & Restore DBs
Generate Scripts for DB, Tables, Procedures
Working with TFS
Powershell@MSUGS21
Get info
–Work Items
–Source Control
Manage
–Workspaces
–Changesets, Shelvesets, Pending Changes
–Build Definitions
–…
Working with Microsoft Azure
Powershell@MSUGS22
Manage
–Storeage
–VMs
–WebSites
–Resources
–Active Directory
–…
Create multi-tier IaaS environments
Powershell@MSUGS23
Working with Sharepoint
Powershell@MSUGS24
Install Sharepoint
Manage
–Site Collections
–Lists
–…
Import/Export
Bezeichnung Präsentation25
Real Life Powershell
Real Life Powershell
Powershell@MSUGS26
.NET Development
–CleanAllProjects.ps1
–PublishAll.ps1
–QueueDeploymentBuilds.ps1
–InstallAppServer.ps1
–InstallWebServer.ps1
Real Life Powershell
Powershell@MSUGS27
Turtle
PSI
System Checker