Archive for the ‘Windows PowerShell’ Category


 

Use PSScriptAnalyzer in PowerShell Studio

Wednesday, May 11th, 2016 by June Blender
Applies to: Windows PowerShell 3.0 and later PSScriptAnalyzer 1.1.0 and later PowerShell Studio 5.2.118 and later PowerShell Studio has long supported best practices in Windows PowerShell, including running and debugging without profiles, avoiding cmdlet and parameter aliases (right-click\Expand to cmdlet, Expand all aliases: Ctrl+Shift+A), using consistent formatting to make maintenance and debugging easier, and using module-qualified command names (Ctrl+Shift+H). Beginning in PowerShell Studio 5.2.118, we've added deep support for PSScriptAnalyzer, the static analysis tool designed especially for Windows PowerShell. To use the Script Analyzer features in PowerShell Studio, you must be running in Windows PowerShell 3.0 and later and have…   More »

How to Write About Help for your Module

Monday, May 2nd, 2016 by June Blender
Since installing PowerShell 5.0, I've been using the PowerShellGet cmdlets to install and examine many of the new modules on PowerShell Gallery. Unfortunately, this is often quite a chore. While many have some help for cmdlets, few have an About topic that tells me how to use the cmdlets together to solve real-world problems. And, in those that do, the About topic feels like the authors wrote whatever popped into their minds at the time. In this post, I'll share my ideas for best practices for writing the primary About_Help topic for your module. Best Practices for a Module About_Help…   More »

Setting Conditional Breakpoints

Wednesday, April 20th, 2016 by June Blender
Applies to PowerShell Studio 2016, PrimalScript 2016, and later. I write lots of scripts — for production, for research, for testing, and for demonstrations. And, inevitably, I hit a bug. I'm actually relieved when I do, because no code is perfect and I'd rather find the bugs before my users do. In fact, I make sure the content in my test database is full of oddities so it's as close to the real world as possible. When you are debugging with a large test sample, like a database or directory, the default line breakpoints are not sufficient. I can hit…   More »

Giving a talk? PowerShell Studio Presentation Features

Wednesday, March 30th, 2016 by June Blender
One of the best parts of the PowerShell community culture is the willingness of people at all levels of expertise to help others to learn. It acknowledges that we learn from each other all the time and pays backward and forward for help that others have given to us. So, there are many people giving talks and presentations about PowerShell. And, PowerShell Studio has several features that make presentations easier. Filegroups: Open all scripts and modules for your presentation in a single click, even if the code files are on different machines in different locations. The files open in PowerShell…   More »

PowerShell Studio 2016: Service Release v5.2.118 and PSScriptAnalyzer

Monday, March 28th, 2016 by David Corrales
We released a new service build for PowerShell Studio 2016 (v4.2.118). Here's what's new:   Support for PSScriptAnalyzer module PSScriptAnalyzer module is a community driven module that evaluates your PowerShell scripts and ensures they follow community approved best practices. http://www.powershellgallery.com/packages/PSScriptAnalyzer/   PowerShell Studio 2016 now allows you to run PSScriptAnalyzer directly from the ribbon (Tools->Analysis->Analyze Script): Note: This option will be disabled if the PSScriptAnalyzer is not installed.   When you use the Analyze Script command, the module results are displayed in the Debug Panel: Jump to the respective line in the script by double-clicking on result.   Triggered Analysis…   More »

Exporting from Modules: A Reminder

Thursday, March 24th, 2016 by June Blender
There are so many new things in Windows PowerShell that I often assume that I know the basics. But, while working on a project about modules, I ran into some new guidance from PowerShell developer Jason Shirk and a great blog post that demonstrates that information about variables in a TechNet topic about module manifests is wrong. Here are some important reminders about modules and their manifests: By default, all functions and aliases are exported, but variables are not exported. "By default, all variables are exported" in How to Write a Module Manifest (MSDN) is wrong. This topic is outdated…   More »

Inheritance in PowerShell Classes

Wednesday, March 16th, 2016 by June Blender
If you're learning about classes in Windows PowerShell 5.0, one of the first new concepts that you'll encounter is inheritance. When you create a class that is based on another class, your new subclass or child class automatically gets the inheritable members (e.g. properties and methods) of the parent class or base class. Inheritance is a really powerful and useful concept, so it's important that you understand it. Fortunately, it's pretty easy. Also, the inheritance principles that you learn in PowerShell are also used in other programming languages, so learning them in PowerShell gives you a head start on new…   More »

PowerShell Studio 2016: Custom PrimalSense

Tuesday, March 15th, 2016 by David Corrales
We've written a series of blog posts to introduce you to the newest features of PowerShell Studio 2016. In this blog, Part 4, we cover new customizable PrimalSense in PowerShell Studio 2016. But, there's more: In Part 1, we review the new UI features, including our new dark themes. In Part 2, we introduce our new debugging features, including variable and function breakpoints and improvements to the Variables pane. In Part 3, we look at some of the new editor features of PowerShell Studio 2016.   Custom PrimalSense Lists The new customizable PrimalSense feature allows users to tailor their PrimalSense…   More »

My First Form: New Videos for PowerShell GUI Beginners

Monday, March 14th, 2016 by June Blender
Like most things, once you know the basics, it's really easy to build GUI applications with Windows PowerShell and PowerShell Studio. And, like most things, it's hard to learn the basics. We're here to help. We just posted a two-part series of videos. You can watch them in any order. My First Form: Build a Simple PowerShell GUI App is a step-by-step guide to building a little PowerShell GUI app that displays the versions of Windows and Windows PowerShell on your system. My First Form: Controls and Properties is like a prequel. It introduces you to the concepts of the Windows Forms controls…   More »

PowerShell Studio 2016: What’s New? (Part 3)

Monday, March 7th, 2016 by David Corrales
PowerShell Studio 2016 is released! We've written a series of blog posts to introduce you to the newest features. In this blog, Part 3, we will look at some of the new editor features of PowerShell Studio 2016. But, there's more: In Part 1, we review the new UI features, including our new dark themes. In Part 2, we introduce our new debugging features, including variable and function breakpoints and improvements to the Variables pane. In Part 4, we show the new customizable PrimalSense in PowerShell Studio 2016.     Import Functions PowerShell Studio already allowed you to convert functions…   More »