Restart-Computer (with BitLocker Suspended)

Create a function called Restart-Computer. Use it to call the Restart-Computer cmdlet. Before you call the cmdlet, suspend bitlocker protection so you don’t get password-pestered at boot time…   function Restart-Computer { Suspend-BitLocker -MountPoint “C:” -RebootCount 1 Microsoft.PowerShell.Management\Restart-Computer }   Why does this work?   There are rules for command precedence…     These rules…

0

Fun & Frolics: Generate a 0 and 1 Screen Stream

What a ridiculous title! Believe me, the post gets even more ridiculous. Anyway, it’s a bit of fun!   I had to do the following for a conference I recently spoke at…   function ExfiltrateData { Write-Output ” ” 1..900 | % {Write-Host “$(Get-Random -Minimum 0 -Maximum 2)” -NoNewline } 1..14 | % {Write-Host “$(Get-Random…

0

Module Manifest - ScriptsToProcess

Here’s a nice little trick. When creating a PowerShell module you can specify a list of scripts to process when the module is loaded. You can use the scripts for validation or prerequisite checking. Here’s a nice little example… In the .psd1* file for the module, i.e. the manifest, add (or uncomment) a line to look…

0

Start-AzureCloudService

Here’s a function I use quite a lot. Now, I know it’s old-world (ASM rather than ARM) in terms of Azure, but I still have a lot of old-world, cloud services. In fact, a lot of them were built by the following script and the function should be considered as partner code.   Build an…

0

Security Focus: Get Mail Enabled Admin Users

Browsing the internet with an admin account is a very, very bad thing to do. Using an admin account to send / receive email is also a very, very bad thing. Why? Well you expose the credentials to a high risk of being stolen and used to compromise your enterprise. Want do to some checks against Active…

1