Posts Tagged ‘PowerShell Studio 2014’


 

Displaying Output in a GUI Application

Monday, December 15th, 2014 by June Blender
After many years of writing scripts for the Windows PowerShell console, I'm now learning the next level of automation -- writing GUI applications that run Windows PowerShell commands. PowerShell Studio forms provide a gentle and well-guided introduction to GUI applications, but it's still taken me some time to break old habits. I constantly need to remind myself that things that "just work" in the console don't make any sense in a GUI. Writing output is one of them. Writing Output to the Console When you generate output in the Windows PowerShell console, the output appears as text strings in the…   More »

PowerShell Studio Templates : Get a head start on your scripts

Wednesday, November 19th, 2014 by June Blender
When you open a new script file (.ps1) in PowerShell Studio 2014, you don’t get a blank page, at least by default. Instead, the page begins with a comment block, like this one: <# .NOTES =========================================================================== Created with:     SAPIEN Technologies, Inc., PowerShell Studio 2014 v4.1.74 Created on:       11/5/2014 4:28 PM Created by:       juneb Organization:     SAPIEN Filename: =========================================================================== .DESCRIPTION A description of the file. #>   This text comes from a template that contains starter text for new script files. In this post, I’ll explain how templates for script files work. I’ll show you where we keep default templates and tell…   More »

Run Selection v. Run Selection in Console

Tuesday, October 28th, 2014 by June Blender
PowerShell Studio is full of features and options. As a new user, I’m trying to learn as many as I can. There are four options in the Run menu, so, of course, I tried them all. But the result was unexpected.     Run and Run Selection run your code and show the result in the Output pane. Run in Console and Run Selection in Console run your code and show the result in the Console pane, which is a separate Windows PowerShell process that PowerShell Studio hosts. That’s expected.   But Run Selection and Run Selection in Console are…   More »

Expand All Aliases: Ctrl+Shift+A

Wednesday, October 22nd, 2014 by June Blender
Windows PowerShell aliases are very handy. They typically have fewer characters than the commands and parameters that they represent, so they’re quicker to type and great for tweeting. However, it has long been an established best practice that aliases should not be used in blogs, in help, in examples, or in any shared scripts and commands. They create an extra layer of confusion for beginners and they’re an obstacle for anyone who needs to maintain the script. Still, we use them. I know that, despite my best efforts, I type “dir” and “where” and “gcm” and “ipmo” and “sls”  and,…   More »

Comment it out!

Wednesday, October 15th, 2014 by June Blender
Today, I was experimenting with hash tables that had keys with multiple values. (More about that later!) But, in the course of my experimentation, I tried one technique and then another and then another. I didn’t want to delete any of my trial code, but I also didn’t want it to run. I just wanted to comment it out. I could have typed a comment symbol (#) on each line or typed the “<#” and “#>” to enclose each code block in a comment block, but PowerShell Studio 2014 makes commenting even easier.   To comment out each line individually…   More »

PowerShell Studio 2014: Refactoring and Other Updates

Tuesday, October 14th, 2014 by David Corrales
In the last PowerShell Studio article, we spoke about the updates to the Function Builder in the v4.1.72 service build. Now we will discuss the other updates in the v4.1.72 build.   Improved Rename Refactoring - We greatly improved the Refactoring speed when renaming variables and parameters. - Refactoring now takes splatting into account when renaming function parameters and variables. - Refactoring now takes Set-Variable and Clear-Variable cmdlets into account. Improved Reference Highlighting To match the rename refactoring, our Reference Highlighting also takes into account the different ways variables and parameters are references: You can trigger Reference Highlighting by double…   More »

PowerShell Studio 2014: More Function Builder Updates

Monday, October 13th, 2014 by David Corrales
Yes, we updated the Function Builder yet again! We just released a new build of PowerShell Studio 2014 (v4.1.72). We wanted to highlight some changes and additions:   Function Validation The Function Builder will now validate your function names by checking if it already exists in your script, thus preventing duplicate functions.   Create Functions from selection If you select a section of script when inserting a new function, the Function Builder will use the selected text as the body of the function. In addition, the function builder will pick potential parameters and present you with the following dialog: In…   More »

Enhanced Input: A grand compromise

Thursday, October 9th, 2014 by June Blender
Life is full of difficult decisions and system admins are faced with them all the time. One tool has three features you like, but another has one you can’t live without. Fortunately, hidden in PowerShell Studio 2014 is delightful feature that bridges the gap between the fully featured Editor Pane and the interactive response of the Console Pane. It’s called the enhanced console input line. The enhance console input line is part of the Console Pane. It runs interactive commands in the console.  But it includes the benefits of the Editor Pane, including PrimalSense (syntax coloring, command completion, etc) and…   More »

Customizing the Console

Tuesday, October 7th, 2014 by June Blender
Even though I’ve been writing scripts for years, I find that I work in the Console Pane in PowerShell Studio 2014 almost as much as I work in the Editor Pane. I use the Console Pane to look up commands and syntax (Get-Command), test a parameter value, or work through the details of a pipeline or a formatting technique before I add it to a script. And, there are many things I do interactively. So, I’m pretty picky about the way my console looks and operates. When I set up PowerShell Studio 2014 on a new machine, one of the…   More »

Adding Parameter Sets to a Function

Thursday, October 2nd, 2014 by June Blender
Like many of you, I really live at the command line, because automation is more efficient than single actions. But, as the command line becomes more complex, we need tools to restore our efficiency. The complex syntax of parameter sets in functions is one of those cases. In this post, I learn to use the new Function Editor in PowerShell Studio 2014. I’m not just playing in a GUI. I’ve automated the command line. ------ When I write functions, I often start with the basic command – the one that makes the function work – and then build in features.…   More »