List/Grid Tips and Tricks Subscribe RSS feed of category Tips and Tricks

#PSTip Find variables in a script

#PSTip Find variables in a script

Note: This tip requires PowerShell 3.0 or later. I had recently completed writing a PowerShell module for an internal project. Within this module, I ended up using variables in the… Read more »

#PSTip Convert .docx to .pdf using Word.Application

#PSTip Convert .docx to .pdf using Word.Application

The Word.Application object can be used to convert Word documents into PDF files. This requires Microsoft Word to be installed on the system on which the code is executed. Using… Read more »

#PSTip Determine compression ratio of compressed files

#PSTip Determine compression ratio of compressed files

In the previous #PSTip Compress files and folders with System.IO.Compression.FileSystem class, a .zip file was created and extracted. Now it might be good to know the compression ratio to see… Read more »

#PSTip Compress files and folders with System.IO.Compression.FileSystem class

#PSTip Compress files and folders with System.IO.Compression.FileSystem class

Using the CreateFromDirectory and ExtractToDirectory methods, it is possible to compress and extract files. In this tip I will show different constructors that can be used to either compress or… Read more »

#PSTip Use Shell.Application to determine which folder is open in File Explorer

#PSTip Use Shell.Application to determine which folder is open in File Explorer

By using the Windows() method and the LocationURL and LocationName properties we can programmatically determine which folder is open in File Explorer. The Where-Object statement is required to filter out… Read more »

#PSTip Get last login date for local account

#PSTip Get last login date for local account

Using the ADSI type accelerator in combination with WinNT provider we can retrieve the last logon time for a local account from the local SAM account database: I created a… Read more »

© 2015 PowerShell Magazine. All rights reserved. XHTML / CSS Valid.
Proudly designed by Theme Junkie.