Created
July 15, 2021 13:29
-
-
Save mikeplate/b88a40f3057453a7258eb1b60cc40edf to your computer and use it in GitHub Desktop.
PowerShell Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run sql command and store result as csv | |
Invoke-Sqlcmd -ServerInstance localhost -Database dbname -Username usr -Password rty "select top 100 * from [Log]" | ConvertTo-Csv -Delimiter "`t" > output.csv | |
# Total size of all files in all subfolders of the current folder | |
Get-ChildItem . -Recurse | Measure-Object -Property Length -Sum | |
# Store result of http request in file | |
Invoke-WebRequest -Uri "https://site.com" | Select-Object -ExpandProperty Content > site.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment