Who knows this, you need a fast random password but you dont have a password generator or something, here is your oneliner:

[System.Web.Security.Membership]::GeneratePassword((Get-Random -Minimum 6 -Maximum  16), 5)

Quick User AD filter:
 $find = Read-Host "Enter Username" ; Get-ADUser -Filter "CN -like '*$find*' -or DisplayName -Like '*$find*' -or Description -Like '*$find*' -or DistinguishedName -Like '*$find*' -or Mail -Like '*$find*'" -Properties * | Sort-Object | Format-Table SamAccountName, displayName 
Quick way of getting installed software:
Get-WmiObject win32_product | Select-Object Name
Grep in PowerShell:
$find = Read-Host "String" ; Get-ChildItem -recurse | Select-String -pattern $find | Group-Object path | Select-Object name
Get files from X date:
$Date = Read-Host "Date like 11.11.2222, Must be past"; $Path = Read-Host "Path";$split = $Date.Split(".");[int]$day = $split[0]; [int]$nextday = [int]$split[0] + 1;[int]$month = $split[1];[int]$year =  $split[2];((Get-ChildItem -File -Path $Path) |  Where-Object {$_.LastAccessTime -gt (Get-Date $day-$month-$year) -and $_.LastAccessTime -lt (get-date $nextday-$month-$year)}).Name
Get NTFS Permissions of a directory:
$Folders = (Read-Host "Path") -Split "\\"; $Plist = $Folders | ForEach-Object { $i = 0 } { $Folders[0..$i] -Join "\" -Replace ":$", ":\"; $i++ };$Plist.foreach{Resolve-Path -Path $_;Get-Item $_ | Select-Object FullName;Get-Acl -Path $_ -Filter Access | Select-Object -ExpandProperty Access} | Format-Table FullName, IdentityReference, FileSystemRights

Leave a Reply