Good PowerShell EXPAND YOUR POWERSHELL SKILLZ BY KIERAN JACOBSEN.

Slides:



Advertisements
Similar presentations
Chapter 6 Server-side Programming: Java Servlets
Advertisements

User-Defined Functions Like short programs Can operate on their own data Can receive data from callers and return data to callers.
Attie Naude 14 May 2013 Windows Azure Mobile Services.
Web Services Darshan R. Kapadia Gregor von Laszewski 1http://grid.rit.edu.
Jason Himmelstein, MVP Senior Technical Director,
James Boother Blog: INTRODUCTION TO POWERSHELL.
Great people, great experience, great passion Administering SharePoint with Windows PowerShell Go Beyond the Management Shell with SharePoint and Windows.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
1 © Prentice Hall, 2002 The Client/Server Database Environment.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Uploading Files. Why? By giving a user the option to upload a file you are creating an interactive page You can enable users have a greater web experience.
Outlook Web Access (OWA) is a web mail service of Microsoft Exchange; allow users to connect remotely via a Web browser OWA is used to access ,
Functions A function is a snippet of code that performs a specific task or tasks. You use a multitude of functions daily when you do such things as store.
UNIT-V The MVC architecture and Struts Framework.
IT 210 The Internet & World Wide Web introduction.
AJAX Chat Analysis and Design Rui Zhao CS SPG UCCS.
JavaScript & jQuery the missing manual Chapter 11
MBA 664 Database Management Systems Dave Salisbury ( )
Momentum 2009 Spyder® for Plant Control John Hutchey – Lou Jones.
Surveys on Steroids New Uses for Kinetic Survey  10 years at Kinetic Data  Phone:  Derick Larson.
.NET Library Objects So far we have looked at the following objects in learning about ASP.NET: Controls Used to control the screen / interface and gather.
M1G Introduction to Database Development 6. Building Applications.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Usability Issues Documentation J. Apostolakis for Geant4 16 January 2009.
Improving Efficiency with Reusable Processes Linda Koestler Kinetic Data.
Module Info Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours
Activating Clarity  Activating Clarity  Activation  Online Activation  Fax Activation  Review and Verify Activation and License Terms  Updating.
ASP/ASP.NET: Tricks and Tips How to get Microsoft’s Programming Language to work for you By Wade Tripp Park University
POWERSHELL SHENANIGANS KIERAN JACOBSEN HP ENTERPRISE SERVICES.
Chapter 6 Server-side Programming: Java Servlets
Copyright © Cybage Software Pvt. Ltd. All Rights Reserved. Cybage Confidential. Drupal Web Services 1 Authored by: Chaitanya Anil Kulkarni Presented.
The Software Development Process
JAVA Programming “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
API Crash Course CWU Startup Club. OUTLINE What is an API? Why are API’s useful? What is HTTP? JSON? XML? What is a RESTful API? How do we consume an.
HTLM Forms CS3505. Form Handling in Browser html User Files out form WEbBROWSErWEbBROWSEr User read response submit Get URL?input html Get file html script.
INTERNET PROTOCOLS. Microsoft’s Internet Information Server Home Page Figure IT2031 UNIT-3.
Tbox is a monitoring solution for all your computer systems Unifies and simplifies management of system surveillance Notifies you in the event of.
Intermediate 2 Computing Unit 2 - Software Development.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
CSC 2720 Building Web Applications Basic Frameworks for Building Dynamic Web Sites / Web Applications.
1 UMBC CMSC 104, Section Fall 2002 Functions, Part 1 of 3 Topics Top-down Design The Function Concept Using Predefined Functions Programmer-Defined.
CMSC 104, Section 301, Fall Lecture 18, 11/11/02 Functions, Part 1 of 3 Topics Using Predefined Functions Programmer-Defined Functions Using Input.
The best of WF 4.0 and AppFabric Damir Dobric MVP-Connected System Developer Microsoft Connected System Division Advisor Visual Studio Inner Circle member.
Introduction to SQL Server Automation with Powershell by Chris Sommer.
Web Page Design The Basics. The Web Page A document (file) created using the HTML scripting language. A document (file) created using the HTML scripting.
Deploying Elastic Java EE Microservices in the Cloud with Docker
National College of Science & Information Technology.
Contoso Insurance Azure App Services Code Sample
Chapter 9: The Client/Server Database Environment
Expand your Powershell skillz By Kieran Jacobsen
The Client/Server Database Environment
DCR ARB Presentation Team 5: Tour Conductor.
The Client/Server Database Environment
CO6025 Advanced Programming
Programming Problem steps must be able to be fully & unambiguously described Problem types; Can be clearly described Cannot be clearly described (e.g.
Ashish Pandit IT Architect, Middleware & Integration Services
Introduction to PowerShell
Partnership.
Component-Level Design
PowerShell Best Practices for SQL DBA’s
Programming in JavaScript
Programming in JavaScript
Grow Your Script From Simple to Module
Coding practices For IT and Computing students 2014.
Web Servers (IIS and Apache)
PHP-II.
Message Passing Systems Version 2
PnP Partner Pack - Introduction
Message Passing Systems
Presentation transcript:

Good PowerShell EXPAND YOUR POWERSHELL SKILLZ BY KIERAN JACOBSEN

Q. What makes a good piece of PowerShell code? Answer: The style of our code, including:  Function architecture  Naming Conventions  Comments  Use of Pipeline  Error handling

Style Guides/conventions  Style guide or coding/programming conventions are a set of rules used when writing the source code for a computer program [WikiPedia]  Date back to the 1970s  Claims to increase readability of and understand-ability of source code, and this reduce the chances of programming errors.  Claims to reduce software maintenance costs  Software developers all work with guides/conventions  We have server naming conventions, account naming conventions, why not scripting conventions?  One of the hardest things for any group to develop, agree upon and to stick to

Script? Function? CMDLet? Module?  Function:Named sections of code  CMDLet:Advanced reusable functions  Script: Complex problems solved with functions and CMDLets  Module:Collections of functions and CMDLets  Libraries  Configuration  Application  Compiled Code Development and Distribution

Functions and CMDLets First  “Think functions not scripts”  “Make CMDLets not scripts”  Design functions and CMDLets first, then build very simple scripts  Functions should do just ONE thing

Naming Conventions  Functions and Cmdlets - Microsoft verbs Vs Defining your down  Singular Nouns  Modules  Scripts  Variables  Parameters  Case

Comment Based Help  Provides detailed help information on our own CMDLets  Descriptions  Examples  Additional Information Links/References  get-help about_comment_based_help

Comments  When and where is appropriate  Variable declarations  Complex IF/For/While/Until conditions  Pipelining  Input validation  Error handling  Anything complex  Don’t over do comments for simple/obvious lines of code.

Handling Errors  When to catch errors  When to throw errors  When to write-error  Error Messages  Exit codes

Bring on the demos!

Demo: Get a web page

Demo: Reusable Get- WebPage

Demo: Getting a file

Demo: Reusable get-webfile

Demo: Posting Data to a page in a reusable way

Demo: A tour of a “Web Functions” module

PushOver.net  Provides push notification support for Android and iOS  Available from App/Play Store  Applications wishing to send notifications, simply post to API web interface or via  Ability to provide high, normal and low priority notifications  Ability to include a URL  Alternatives are out there

Demo: PushOver Notifications

Demo: SysInternals Script

Demo: Chocolatey

Questions?  Website:    GitHub Projects  WebFunctions:  PushOverPS: