Archive for the ‘Tip’ Category


Introducing the SAPIEN Information Center

Tuesday, July 12th, 2016 by June Alane Reif
Over the years, the articles in this blog have grown extensively. There's a lot of valuable information in here, but it's become hard to find because it's mixed in with various tour announcements, special offers, conference recaps, and the like. So, we have decided to pull the important articles and place them—along with information relevant to PowerShell and scripting—in a more organized and easily searchable venue. We are proud to introduce the SAPIEN Information Center. The most recent articles are always highlighted in a list on the left side of the window. The SAPIEN Information Center currently has the following…   More »

Calling a method without parentheses

Friday, April 22nd, 2016 by June Blender
Late breaking news from PowerShell Conference Europe 2016!! During PowerShell MVP Chrissy LeMaire's (@cl) knockout session at PowerShell Conference Europe 2016, "My Journey to 200,000 Rows a Second" (don't miss the recording; I'll tweet as soon as it's available), PowerShell Principal Developer Bruce Payette (@BrucePayette) said that you can call the Where method without parentheses. [caption id="attachment_11844" align="alignnone" width="300"] Chrissy LeMaire and Bruce Payette at PowerShell Conference Europe[/caption] "It's a syntactic twiddle," he explained, as only Bruce can. In an exclusive interview, Bruce clarified that, beginning in PowerShell 4.0, you can call ANY method in PowerShell without parentheses if it…   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 »

Open a SAPIEN Forum from PowerShell

Monday, March 21st, 2016 by June Blender
UPDATE:  Added a -Search parameter that searches all SAPIEN forums for the term that you specify and then opens the page with the results. Thanks to Prasoon V. Karunan for the contribution. I love helping people learn Windows PowerShell and SAPIEN products. I answer questions on Facebook, Twitter, Reddit (love the /r/powershell subreddit), Google+, Slack, email, in the line at Starbucks, etc. But, I'm also a scripter, and I know the value of automation and efficiency. So, rather than answer one question for one person, I'd rather answer each question for many people. And, to get the best answer, I'd like…   More »

Is there a PSEdit for PowerShell Studio?

Wednesday, February 24th, 2016 by June Blender
My friend, Thom Schumacher, who has been leading the Arizona PowerShell User Group for the past few months, is getting to know PowerShell Studio. Like many of us, he came to PowerShell Studio from PowerShell ISE, so he looks for the "ISE way" to do things in PowerShell Studio. "How do I use PSEdit in PowerShell Studio?," Thom asked on Twitter. Here's my answer. Um, you don't need it Being very literal, you don't need the PSEdit function in PowerShell Studio. The PSEdit function, which is defined in and works only in PowerShell ISE (not in the ISE module), opens…   More »

Enable WMI Explorer Windows 8 Remote Connection Permissions

Monday, December 14th, 2015 by Devin Leaman
Earlier in October, I posted a blog about remote connection failures that occur when using WMI Explorer on a remote computer running Windows 8. This solution doesn't apply to computers running other versions of Windows. To sum it up, you need to make three changes for WMI Explorer to connect to a Windows 8 remote machine. Allow Remote Administration through the Windows Firewall Give the user the required remote access to COM security Give the user the required remote access to the WMI root namespace and sub-namespaces. For those who have this issue, but don’t have the time to go…   More »

Engine Type Prerequisites

Monday, November 16th, 2015 by Devin Leaman
When building executables in PrimalScript or PowerShell Studio there are various engine types to choose from, each of them with a prerequisite that must be installed on the machine that will be running your program. For example, if you build an executable in PowerShell Studio and select the SAPIEN PowerShell V2 Host (Command Line) Win32 engine then the .NET Framework 2.0 is required on the target machine. Here is a table that shows the prerequisites for each engine type: Engine Prerequisite SAPIEN PowerShell V2 Host (Command Line) Win32 .NET Framework 2.0 SAPIEN PowerShell V2 Host (Command Line) x64 .NET Framework 2.0 SAPIEN PowerShell V2…   More »

Why does this button close my form?

Monday, June 29th, 2015 by David Corrales
Have you ever copied a button and found that when a user presses it, the form closes immediately afterwards? We are here to answer: Why does this button close my form? The reason the form closes is that the Button control’s DialogResult property is set to a value other than None. This property tells the form to close after the user has clicked the button without you having to explicitly close the form in the button’s click event script block. So next time you copy an OK or Cancel button, be sure to set the button’s DialogResult to None. For…   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 »