PowerShell and COM objects.

While developing a COM object for scripting use I wanted to provide a VBScript sample as well as a PowerShell sample. While creating the PowerShell sample I received an unexpected error message when setting a property value. Some quick review…
Read More

Touch This

One of the last tasks for the Active Directory Powershell book was to assemble all the script samples. When the book is available you’ll be able to download a zip file from SAPIENPress.com. One thing I wanted to do was…
Read More

More Fun with Debug Messages

A few weeks ago I posted an entry on creating customized debug messages that you can use in your scripting. After some more testing and tweaking I revised and renamed the function. Write-DebugMessage can now be used within your script…
Read More

PowerShell: DriveUtilization

The other day I posted a VBS function for getting drive utilization. It seems only fair to give PowerShell a chance to play. 1: Function Get-Utilization { 2: Param([string]$computername=$env:computername, 3: [string]$ID="C:" 4: ) 5: 6: #suppress errors messages 7: $errorActionPreference="silentlycontinue"…
Read More

VBScript: Drive Utilization

Here’s another recent topic from the ScriptingAnswers.com forums which I thought I’d share. The forum members wanted to delete files if the drive utilization exceeded a certain threshold. Using Windows Management Instrumentation (WMI) with VBScript I came up with something…
Read More

"Live" Variables

In a recent PowerShell ScriptingAnswers.com post, a member was asking about variables and whether they were “live” or linked to an actual object.The answer is “Yes and No, depending…”  For example, consider this expression: PS C:\> $s=get-service wsearch The $s…
Read More

Fun with Debug Messages

In my script and function development, I often add the line $DebugPreference="SilentlyContinue" to the beginning of my code. Throughout the script I add lines using Write-Debug that tell me what the script is doing or the value of a particular…
Read More

Export-PSCredential

Hal Rottenberg has put together a very nice set of functions for exporting and importing PSCredential to a file. The export function takes a PSCredential and serializes it to an XML file. The corresponding import function reconstitutes the PSCredential to…
Read More

RSS SAPIEN Info Center

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