Finding large files with Powershell

Finding all files greater than 1GB with Powershell: Get-ChildItem -recurse -force -erroraction silentlycontinue | where {$_.Length -gt 1Gb} | ft If you want to find the 5 largest files, use the following: Get-ChildItem -recurse -force -erroraction silentlycontinue | where {$_.Length -gt 1Gb} | sort-object -Property Length | select-object -Last 5 This is a bit clunky … Continue reading Finding large files with Powershell

Creating Local Accounts in Powershell

Ok, creating a user account with Powershell- what's interesting about this? Well, let's take a look: It's noteworthy to point-out that you need to convert the password to a secure string. Otherwise, you'll end up with a error like this: A secure string is required for a password creation. If you're creating the account interactively, … Continue reading Creating Local Accounts in Powershell

Finding Long File Paths with Powershell

If you've done many Windows file server migrations, you've certainly come across a long file path issue.  There are a number of ways to address it. For me, it's preferable to know where the files are ahead of time rather than just stumble upon failures when running copies.  Thankfully, Powershell can help us locate the … Continue reading Finding Long File Paths with Powershell

A Quick and Dirty Method for Auditing Permissions by Keyword with Powershell

Auditing NTFS permissions in Windows is not a fun task, especially in environments that may have a lot of broken inheritance deeper in the file structure. In such scenarios, Powershell can be a powerful tool to help spot check permissions, given certain keywords. The script below would be run from the Windows Server sharing the … Continue reading A Quick and Dirty Method for Auditing Permissions by Keyword with Powershell

Detecting where Folder Permissions are not Inherited with Powershell

Occasionally, you'll find a file server that has had permissions no longer inherited in a bunch of seemingly random places and it can be difficult to sort out where to begin with necessary changes moving forward. I happen to stumble upon how to get better visibility into inheritance with Powershell: In the example below, I … Continue reading Detecting where Folder Permissions are not Inherited with Powershell

Powershell Text to Speech

My uses for Powershell have always been very utilitarian.  However, recently I became aware that you can actually do text-to-speech, so I thought I'd play around with it a bit. This is about the simplest example: Add-Type -AssemblyName System.speech  $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer  $speak.Speak('Hello, Is it me you're looking for?') There are some additional options I came across here. As … Continue reading Powershell Text to Speech

Powershell Snippets: Working with Zipped Files

Ok, here's just some basic syntax for working with Zip files with Powershell.  This was tested with Powershell 5.1...likely backwards compatible a few versions. This does the following: Creates a local folder if it doesn't exist Downloads a zip file from the web to the created local folder (URL below just a random zip I … Continue reading Powershell Snippets: Working with Zipped Files

Download and Install Applications from the Web with Powershell

For various administrative purposes, it can be useful to download files and install via Powershell. There are a few ways to do it, but with Powershell 5.1, I'll leverage invoke-webrequest and start-process. In the example below, I'm downloading Windows Powershell for AWS installer, using /qn to install silently. As always, don't forget to Run As … Continue reading Download and Install Applications from the Web with Powershell