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 »

Expand All Aliases: Ctrl+Shift+A

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 »

Introducing the 4th Edition of Windows PowerShell TFM

October 21st, 2014 by Lanae Dale
We are EXTREMELY pleased to announce the arrival of the 4th Edition of Windows PowerShell TFM; the latest, most up-to-date information available for the PowerShell version 4.0! Jason Helmick and Mike Robbins have taken the baton from Don Jones and Jeff Hicks, working vigorously to deliver useful, practical information in a resource that all levels of expertise can turn to. Whether you are in the beginning stages, or a seasoned veteran, we wanted to make sure you would be offered everything that you need. It is a learning guide, a lab guide, and a PowerShell reference all bundled up in…   More »

A Better ToString() Method for Hash Tables

October 21st, 2014 by June Blender
I didn’t make it to the PowerShell Summit 2014 in Europe this year, but I’ve been getting much of the benefit by watching the Summit presentations on YouTube. After watching Windows PowerShell MVP Bartek Bielawski’s excellent presentation, in which he reviews PSCustomObjects and dynamic type data, I was inspired to fix a shortcoming in the .NET framework that often frustrates me. It’s easy to create a hash table in Windows PowerShell: @{Name = "Fred"; ID = "3"}   And, beginning in Windows PowerShell 3.0, it’s easy to get a hash table string from a file and convert it to a…   More »

PowerShell Studio: Form and Script Recovery

October 20th, 2014 by David Corrales
Once in a while our support team gets a request to recover a script from a packaged executable because the original was lost. In fact this just happened recently when a user contacted us to recover his lost form project from his packaged script. We were able to recover the script, but unfortunately the user still had to rebuild all his GUI forms from scratch. He was at least fortunate enough to be able to copy and paste the script portions of his project without having to completely rewrite it all. Please don’t find yourself in the same situation. For…   More »

WMI Explorer 2014 Service build 2.0.47

October 17th, 2014 by Alex Riedel
Our WMI Explorer 2014 gets a minor update with build 2.0.47. The new Server dialog lets you edit settings after the fact, for example when the password changes. You may notice the new “Root” field in the settings dialog, which is now also present in the initial dialog when connecting to a new computer. If you are only interested in a particular  namespace on a server or, even more important, if you only have permissions to a specific namespace and have no access to ‘root’ then this is what you need. All namespaces specifications have to start with ‘\root’, so…   More »