Archive for the ‘Howto’ Category


 

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 »

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 »

Update-Module 5.0 adds, not updates

Wednesday, February 17th, 2016 by June Blender
Applies to: -- Windows PowerShell 5.0.10586.63 -- PowerShellGet 1.0.0.1 I'm a huge fan of sharing Windows PowerShell modules and making them easy to find (Find-Module), view (Save-Module), and install (Install-Module). So, I truly love the new PowerShellGet module. However, you really need to understand how it works before you use it. Otherwise, you might end up with commands and modules that don't work correctly (or at all) or don't do what you expect. Or, you might download modules with commands that shadow or hide commands that your scripts run. Update-Module is one of the really useful cmdlets in PowerShellGet, but if you don't know…   More »

Using Prefixes to Prevent Command Name Collision

Monday, February 15th, 2016 by June Blender
In January, I had the honor of presenting to the Mississippi PowerShell User Group (MSPSUG). I've known the organizers, Mike Robbins and Rohn Edwards for years, and truly respect them. The PSUG is online-only, which makes it a challenge for presenters, but they attract a very sophisticated audience, so my talks there are really conversations. This was a perfect venue for my "Avoiding Version Chaos" talk. (More at PowerShell Saturday in Tampa on March 19, 2016.) In one part of the talk, I demonstrated how to use noun prefixes to distinguish among commands with the same names. The demo flopped…   More »

Using Group-Object to Detect Command Name Conflicts

Wednesday, February 10th, 2016 by June Blender
The Group-Object cmdlet, one of the original provider cmdlets, is as old as Windows PowerShell. It was introduced in version 1.0 and hasn't changed at all since then. But, it is one of my favorites. (You can tell when I love a cmdlet by the number of examples. Group-Object has 9!) In fact, when you use it frequently, you begin to see groups as a path to many solutions. Group-Object groups objects by the values of a property that you choose. So, it's a quick way to find the property values that appear in a data set. Which domain controllers are used by users…   More »

PowerShell GUI Apps: Why think in events?

Monday, January 4th, 2016 by June Blender
Always committed to starting the New Year right, I’m heading to Scottsdale, Arizona on Tuesday, January 5 at 5:30 PM to meet with the newly revived Arizona PowerShell User Group. We’ll meet at the Microsoft Store in Scottsdale Fashion Square. (I will not be distracted by the Surface Pro 4 on display. I will not…)   I’ll be there to lead an interactive hands-on lab in which participants build a basic PowerShell GUI application – essentially, a graphic user interface for a PowerShell script. When you press a button, it runs part of the script. When you type text in…   More »

How I learned to love DialogResult

Wednesday, December 23rd, 2015 by June Blender
This post discusses the DialogResult property of buttons, which often confuses beginning PowerShell GUI app designers. When I first started learning how to write PowerShell GUI applications, I thought of the DialogResult property of buttons as the "evil property." What else would I think? If the DialogResult property of a button is set to any value other than None, when you click the button, the GUI app closes immediately after running the commands in my event handler. In this little app, when you click OK, it pipes a Get-Service command to Out-GridView -- um, very briefly. [video width="1280" height="670" mp4="https://www.sapien.com/blog/wp-content/uploads/2015/12/DialogResult.mp4"][/video]…   More »

Where are v3 and v4? PowerShell Versions in PowerShell Studio

Monday, December 21st, 2015 by June Blender
In this post, we explain why PowerShell Studio can run your scripts only the versions of Windows PowerShell that are installed on local and remote computers. If you've recently upgraded to Windows 10 from Windows 7, 8, or 8.1, you'll notice quickly that you now have Windows PowerShell 5.0. Depending on your upgrade path and subsequent updates, you might be running any version of Windows PowerShell greater than or equal to 5.0.10240. Or, you might have installed the shiny new Windows Management Framework 5.0 for Windows 7 SP1, Windows Server 2008 R2, and later versions of Windows client and server. In…   More »

Output from a Script in an Executable File

Thursday, December 17th, 2015 by June Blender
This is the fourth blog in a multi-part series about designing a Windows PowerShell script that will be packaged in an executable file. Passing Parameters to a Script in an Executable File explains how to use the special parsing features of PowerShell Studio and PrimalScript to make passing parameters easy for PowerShell users and authors. Parsing Parameters for a Script in an Executable File explains how to parse parameters manually for special uses. Displaying Help for a Script in an Executable File explains how to display help for a script in an executable file. Output from a Script in an…   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 »