Blog

PowerShell Studio Templates : Get a head start on your scripts

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 »

Removing Objects from Arrays in PowerShell

November 18th, 2014 by June Blender
  A member of the PowerShell group on Facebook asked how to delete an object from an array. It's a simple question, but the answer isn't very simple at all. It's one of those beginner questions that has an advanced answer. When I first answered this question in about_Arrays, I didn't really know much about the subject and I used the (very good) answer that the team gave me. But that answer was incomplete, and while there are many good posts on the topic, none really cover the whole scope of pitfalls. [Be sure to start with about_Arrays. I'll assume…   More »

Update-OneGet: Install OneGet on PS 3.0+

November 14th, 2014 by June Blender
One of the coolest new features in the Windows PowerShell 5.0 preview is the OneGet module. Windows PowerShell program manager, Dan Harman, describes OneGet as a "package manager manager," but for most of us, it represents a simple, repeatable, and reliable way to install, update, and uninstall a variety of available programs from a variety of sources. For example, if you want to install MarkDownPad2, a very simple and highly regarded HTML mark-up (or down) editor, you run a command like this: Find-Package MarkDown2 | Install-Package Yes. It's just that easy. Really. And, if you need to uninstall it. Get-Package…   More »

BOOK BLOWOUT, CLEARANCE SALE!

November 7th, 2014 by Lanae Dale
                           Save big now! Originally priced at $59.99, get your copy of Microsoft Hyper-V or WSH and VBScript Core printed books for only $15.00 each, shipping included, while supplies last! Offer valid in the continental United States only. Microsoft Hyper-V A practical guide to implementing Hyper-V in your environment. Microsoft Hyper-V, focuses on giving you a practical guide to implementing Hyper-V in your environment; everything from installing your first Hyper-V server to building clustered environments for complex systems. This book includes instructions for managing Hyper-V using the built-in Hyper-V Manager or Systems Centre Virtual Machine Manager (VMM), as well as,…   More »

The Fourth Edition of Windows PowerShell: TFM Now Available on Amazon

November 6th, 2014 by Lanae Dale
  As of November 5th, 2014, SAPIEN’s newest edition of Windows PowerShell: TFM is available for purchase on Amazon.com.  Whether you are located in the United States or Internationally, the ability to purchase the book is now here!  The 4th Edition of Windows PowerShell: TFM contains 22 chapters in the learning guide, as well as 16 additional “in depth” sections relating to topics administrators may face in their everyday lives.  Please proceed to the following Amazon link to purchase the newest addition to your Windows PowerShell TFM: library: http://www.amazon.com/Windows-PowerShell-Jason-Helmick/dp/0982131461/ref=sr_1_3?ie=UTF8&qid=1415222684&sr=8-3&keywords=Jason+Helmick We are looking forward to hearing your reviews.  If you…   More »

Throwback Thursday: Making batch files into executables

October 30th, 2014 by Alex Riedel
PrimalScript 2014 can make a variety of script files into executable files. We call that packaging. This feature is mostly used by VBScript and PowerShell administrators to wrap their scripts into an executable file that can be shipped to end users and prevent prying eyes from seeing what makes the magic happen. For the aforementioned VBScript and PowerShell scripts this usually means a package that executes the code in memory, without the use of a temporary file. We did however receive quite a number of requests lately to also package Batch or CMD files. Here is where the “Throwback Thursday”…   More »

Accessing VersionRecall repositories from another computer

October 29th, 2014 by Alex Riedel
Whether you are getting a new computer or another person joins your team, getting everything set up in a new environment can be a time consuming task. VersionRecall 2014 can help to make this easier. If you have your scripts and related files connected to a VersionRecall repository, you can very easily transfer those files to another machine. Simply select the new “Import repository…” function in VersionRecall 2014 (1.0.107 or later) and navigate to your remote repository. Select the .recall file with the settings you would like to use. The files stored in the repository have the machine and user…   More »

Run Selection v. Run Selection in Console: PowerShell Studio 2014

October 28th, 2014 by June Blender
PowerShell Studio 2014 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…   More »

Get-Duplicates (or Unique items)

October 27th, 2014 by June Blender
I take a lot of free online coding classes, mainly from Coursera and Udacity, and I’ve picked up a lot of programming tricks in other languages that are easy translated to Windows PowerShell. In a Java class on Udacity, I learned a cool way to find duplicates in any collection. It uses the fact that the keys in hash tables must be unique. The parser throw an “Item has already been added” error if you try to add a key that’s already in the hash table. In this example, I try to add “Day” to a hash table that already…   More »

Saving Passwords for Add-AzureAccount

October 23rd, 2014 by June Blender
One of the great features of the recent versions of Azure PowerShell is a non-interactive option for the Add-AzureAccount cmdlet. Unfortunately, the instructions tell you to save your Azure password in plain text, but there are much more secure alternatives. I explain one in this post. ------------------- As users of Azure PowerShell know well, there have always been two distinct ways of making your Azure account available to Windows PowerShell. You can download (Get-AzurePublishSettingsFile) and import (Import-AzurePublishSettingsFile) a PublishSettings file. This technique uses a management certificate with security credentials and, while it’s a bit more complex, once the certificate…   More »