Showing archive results for September 2015

Sep 15, 2015
Post comments count0
Post likes count0

PowerTip: Get First 140 Characters from String with PowerShell

Doctor Scripto

Summary: Use Windows PowerShell to retrieve the first 140 characters from a string.  How can I use Windows PowerShell to retrieve the first 140 characters from a string?  Use the SubString method from a string. Specify the starting point (in this case 0) and the            number of characters to re...

Scripting Guy!Windows PowerShellPowerTip
Sep 15, 2015
Post comments count0
Post likes count0

Error Handling: Two Types of Errors

Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about error handling and two types of errors.  Hey, Scripting Guy! I really don’t get it. Everyone tells me I need to use Try/Catch/Finally to catch errors, but it simply won’t work. I am not sure if there is a bug in Windows PowerShell, but I wish you guys would fix it because it ...

Scripting Guy!Windows PowerShellscripting techniques
Sep 14, 2015
Post comments count0
Post likes count0

PowerTip: Find PowerShell Exported Types

Doctor Scripto

Summary: Learn how to find Windows PowerShell exported types.  How can I easily look at runspace exported types in Windows PowerShell?  Call the Assembly property from the [psobject] type accelerator, and then call the GetExportedTypes() method,            for example: [psobject]...

Scripting Guy!Windows PowerShellPowerTip
Sep 14, 2015
Post comments count0
Post likes count0

Backwards Compatibility in PowerShell

Doctor Scripto

Summary: Ed Wilson, Microsoft Scripting Guy, talks about backwards compatibility in Windows PowerShell. Hey, Scripting Guy! I wrote a script on a system with Windows PowerShell 4.0 installed. Is there an easy way to find out the earliest version of Windows PowerShell on which it will run?—DH Hello DH,Microsoft Scripting Guy, Ed...

Scripting Guy!Windows PowerShellscripting techniques
Sep 13, 2015
Post comments count0
Post likes count0

PowerTip: Use PowerShell to Create New Virtual Disk

Doctor Scripto

Summary: Use Windows PowerShell to create a new virtual disk.  How can I use Windows PowerShell to create a new virtual disk?  Use the New-VirtualDisk cmdlet, for example: New-VirtualDisk -StoragePoolFriendlyName Data -FriendlyName MyData -Size 10GB

Scripting Guy!Windows PowerShellPowerTip