Download - Power shell saturday ravikanth
![Page 1: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/1.jpg)
Sponsored by SAPIEN
PowerShell Saturday Singapore 01: PowerShell 4.0
Brought to you by Singapore PowerShell User Group
http://www.facebook.com/singaporepowershell
http://powershell.org/wp/user-groups/singapore-powershell-user-group/
Speaker: Ravikanth C
Twitter: @Ravikanth
FaceBook: Ravikanthc
Blog: http://ravichaganti.com/blog and http://www.powershellmagazine.com
![Page 2: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/2.jpg)
Sponsored by SAPIEN
Thank you to the Sponsors
Prizes Sponsored by SAPIEN Technologies• Download a trial of SAPIEN PowerShell Studio 2012:• http://www.sapien.com/powershellstudio
![Page 3: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/3.jpg)
Sponsored by SAPIEN
About Me
• 12+ years in IT; Lead Engineer for MS Collaboration Solutions at Dell• PowerShell MVP since 2010• Founder and Editor of PowerShell Magazine• Community Lead• Bangalore IT Pro User Group (@BangaloreITPro)• PowerShell Bangalore User Group (@PSBug)
![Page 4: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/4.jpg)
Sponsored by SAPIEN
Windows Management Framework 4.0• Includes Updates to …• PowerShell• PowerShell ISE• PowerShell Web Services
• Not updated in the current build• Windows Remote Management (WinRM)• Windows Management Instrumentation (WMI)
![Page 5: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/5.jpg)
Sponsored by SAPIEN
PowerShell 4.0 - Requirements
• Requirements• Windows Server 2008 R2 SP1 (x86 and amd64)• Windows 7 SP1• Windows Server 2012• .NET Framework 4.5• No Windows 8 yet!
![Page 6: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/6.jpg)
Sponsored by SAPIEN
What is new?
• Several enhancements to existing features and cmdlets!• Desired State Configuration (DSC)
![Page 7: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/7.jpg)
Sponsored by SAPIEN
Elevated Privileges
• #Requires can now be used for checking administrative credentials• #Requires -runasadministrator
![Page 8: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/8.jpg)
Sponsored by SAPIEN
PowerShell Web Access
• Supports connecting and disconnecting from sessions• Default values for the connection settings can be updated via
Web.config
![Page 9: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/9.jpg)
Sponsored by SAPIEN
Pipeline Variable
• Useful in iterative pipelines• Pipeline variable becomes available throughout the pipeline• Cmdlets support -PipelineVariable
![Page 10: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/10.jpg)
Sponsored by SAPIEN
Method Syntax for Filtering
• Perform object filtering by using Where() method on the object collection• Part of Desired State Configuration Module• Not all operators are supported
![Page 11: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/11.jpg)
Sponsored by SAPIEN
Dynamic Method Names
• Dynamic Properties support has always been there• Variables can be used to invoke methods dynamically
![Page 12: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/12.jpg)
Sponsored by SAPIEN
Built-in cmdlet for file hashing
• Get-FileHash• MACTripleDES• MD5• RIPEMD160• SHA1• SHA256• SHA384• SHA512
![Page 13: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/13.jpg)
Sponsored by SAPIEN
Other Changes
• Get-Process include UserName• Remote and workflow script debugging• -Runnow support for Register-ScheduledJob and Set-ScheduledJob• -RepeatIndefinitely support for New-JobTrigger and Set-JobTrigger• -Workgroup parameter support for Add-Computer and Remove-
Computer• http://technet.microsoft.com/en-us/library/hh857339.aspx
![Page 14: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/14.jpg)
Sponsored by SAPIEN
Desired State Configuration
• Platform that enables deployment and management of configuration data• DSC provides• Language extensions• Cmdlets to manage DSC• Resources to specify the configuration• Means to maintain and manage configuration
• Uses PowerShell remoting• Uses declarative syntax
![Page 15: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/15.jpg)
Sponsored by SAPIEN
Imperative vs Declarative Syntax
• Imperative – How a task needs to be performed• PowerShell is imperative by design
• Declarative – What task needs to be performed
![Page 16: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/16.jpg)
Sponsored by SAPIEN
DSC – Terminology
• Configuration• Node• Resource
![Page 17: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/17.jpg)
Sponsored by SAPIEN
DSC - Resources
• Built-in Resources• Archive• Environment• File• Group• Log• Package• Process• Registry• Role• Script• Service• User
• Possible to create custom resources
![Page 18: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/18.jpg)
Sponsored by SAPIEN
DSC – Custom Resources
• Written as PowerShell Modules• Copy to C:\Windows\System32\WindowsPowerShell\v1.0\Modules\
PSDesiredStateConfiguration\PSProviders• Requires
• MOF Schema• Module Script
• Get-TargetResource• Set-TargetResource• Test-TargetResource
• Module Manifest
![Page 19: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/19.jpg)
Sponsored by SAPIEN
DSC – Push vs Pull
• Push• Pros
• Simple• Control
• Cons• Lack of complete automation• Limited Scalability
• Pull• Pros
• Complete Automation• Scalability
• Cons• ?
![Page 20: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/20.jpg)
Sponsored by SAPIEN
DSC – Pull Server
• Windows Feature
• Available on Windows Server 2012 and 2012 R2• An IIS endpoint
![Page 21: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/21.jpg)
Sponsored by SAPIEN
DSC – Local Configuration Manager
• DSC Engine• Runs on all nodes• Responsible for calling the DSC resources• LCM properties can be updated to use pull model; of course, using
DSC
![Page 22: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/22.jpg)
Sponsored by SAPIEN
Summary
• DSC is the biggest thing in PowerShell 4.0• Get started with DSC!
![Page 23: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/23.jpg)
Sponsored by SAPIEN
References
• Windows Management Framework 4.0 Downloadhttp://www.microsoft.com/en-us/download/details.aspx?id=39347• What is new in PowerShell 4.0?
http://technet.microsoft.com/en-us/library/hh857339.aspx• Desired State Configuration
http://technet.microsoft.com/en-us/library/dn249912.aspx• Imeprative vs Declarative Syntax in PowerShell
http://www.powershellmagazine.com/2013/07/05/imperative-versus-declarative-syntax-in-powershell/
![Page 24: Power shell saturday ravikanth](https://reader033.vdocuments.us/reader033/viewer/2022061204/547edb1fb4af9f246e8b4906/html5/thumbnails/24.jpg)
Sponsored by SAPIEN
Q & A