Cool Config Creation

In my recent Special Forces PowerShell class, one of the students brought up a challenge he was facing when we were talking about the -f replacement operator. This is a handy way to build strings.

PS C:\> “Hello, {0}. It is now {1} and you have {2} processes running.” -f $env:username,(get-date).ToShortDateString(),
(get-process | measure-object).count
Hello, Jeff. It is now 5/5/2009 and you have 82 processes running.

Paul needed to build configuration files and was looking for an easy way, perhaps using a here string as a template. We tossed around a few ideas. When I got home I decided to see what I could come up with. What I have is a proof of concept really, but it might get you started.

Read More

Patch Tuesday

Like almost every month, we have released service builds for our products. As we have quite a few new products we will formalize this procedure and always attempt to use the first Tuesday of every month to release any necessary service builds. The following products and versions have been updated: PrimalScript 2009 PrimalScript 2007 Enterprise […]

Read More

Up another PowerShell Tree

A few weeks ago I posted a PowerShell script that created a directory tree, like the TREE command from the CMD shell. Then while testing something new in PrimalForms, I realized I had a literal form object, a tree view, that I could use. So I put together a short script that creates a graphical tree for a given directory, along with the file counts and sizes from my original scripts. As a bonus, because I now had a graphical interface I could do things such as display empty folders in a different color. The script not only gives you a handy tool but also serves as a demonstration on how to use a TreeView control.

Read More

PrimalForms – File Dialog Hangs on Windows Vista SP1 with .Net 3.0 /3.5

Some of our PrimalForms users may have encountered issues with the OpenFileDialog or SaveFileDialog running under Windows Vista. The bad news is that scripts which include OpenFileDialogs or SaveFileDialogs and that previously worked on Windows XP may encounter freezing issues on Vista SP1 systems with .Net 3.0/3.5. The affected scripts will hang when PowerShell executes […]

Read More

Editing PrimalForms

I continue to play with PrimalForms and I know many of you are as well. I thought I’d share a few other techniques for creating scripts and moving between the code generated by PrimalForms and the script you create in PrimalScript. One technique that I’ve started using is to leverage PrimalScript’s snippet feature.

Read More

Script Packager packs new features.

PrimalScript 2009’s Script Packager contains two new target executables and easier manifest handling. The increasing popularity of PowerShell and the large numbers from the PrimalForms download prompted us to add dedicated targets to PrimalScript’s Script packager: These two new options allow you to package your PowerShell script into a stand-alone exe file. When executed, this […]

Read More

Local Password Management Form

I’m very happy to see PrimalForms spreading in popularity and acceptance. One topic I come across is the need for more samples, and of course, I’m happy to oblige.

I put together a short form script to manage local account passwords.

Read More

Winforms and Timers

There’s been some discussion lately in the SAPIEN product forums about PrimalForms and timers. As you know, PowerShell v1.0 is essentially single-threaded. This generally means that timers and asynchronous code won’t work. But you can use a simple timer in a Windows form. Here’s an example of how you might use such a timer.

Read More

PowerShell WMI Wizard

If you are a long time PrimalScript user, you know that it has always had support and wizards for WMI. The upcoming PrimalScript 2009 adds some new WMI features. But I like to tinker, especially with PowerShell. So I created a simple PowerShell script that creates an expression using Get-WMIObject. Think of it as a PowerShell WMI Wizard script.

Read More

PrimalScript Packaged PrimalForm PowerShell

I hope you’ve been playing with the free PrimalForms tool and started creating some useful PowerShell tools. Here’s a technique you might want to explore if you are using PrimalScript. If you’ve used the PrimalScript for awhile you likely are aware of the script packaging feature. You can use it to package your PowerShell scripts into an EXE file. Remember though, PowerShell needs to be installed wherever you may want to execute your package. But once packaged, launching the file will display your WinForm based script. Let me show you some ways to leverage script packaging and PowerShell scripts.

Read More

Search

Enter any query and press enter
Advanced search operators:
+ ⟶ Term must appear
- ⟶ Term must not appear
"" ⟶ Exact string must appear
How do I use these?

Join our mailing list

Enter your email address to subscribe to our mailing lists for Monthly Blog Digests, Product Announcements and more (you can choose which you receive once you sign-up!)

Tags

Categories

Archives

Dashboard