Powershell

Managing Printers

Windows 8.1 or Server 2012 R2 Both Windows 8.1 and Server 2012 R2 come with a module called “PrintManagement”. It includes all cmdlets...

read more

Simplifying .NET Types

All PowerShell versions PowerShell uses short names for the most common .NET types. To see if there is a short name for a .NET type you are using,...

read more

Mapping Drives

PowerShell Version 3 and later To permanently map a network drive, use New-PSDrive with the –Persist parameter. This parameter makes the drive...

read more

Conditional Breakpoints

PowerShell 3.0 and later The PowerShell ISE supports line breakpoints only: they make the code stop once the debugger hits that particular line. You...

read more

Dealing with Hidden Files

PowerShell 3.0 and later When you use Get-ChildItem to list files, by default, hidden files are excluded. To include hidden files, use the...

read more

Dealing with %ERRORLEVEL%

All PowerShell versions When you run native EXE console commands inside your scripts, these commands typically return a numeric return value. This...

read more

Compacting Paths

[WindowsAPILib.Helper _i="0" _address="0" theme_builder_area="post_content" /][WindowsAPILib.Helper _i="1" _address="1"...

read more

Creating Huge Dummy Files

All PowerShell versions If you need to stress test systems, or need large dummy files for other purposes, here is some code that can create even...

read more

Cloning NTFS Permissions

All PowerShell Versions Here is some simple code that reads the NTFS permissions from one folder and applies the exact same settings to another....

read more
1 68 69 70 71 72 130