This file contains hidden or 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
| ### | |
| ### Without splatting | |
| ### | |
| Get-Process -Name dns -ComputerName localhost | |
| ### | |
| ### With splatting | |
| ### | |
| $myparamas = @{ |
This file contains hidden or 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
| ### Load ADAL | |
| Add-Type -Path "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Services\Microsoft.IdentityModel.Clients.ActiveDirectory.dll" | |
| # Set AAD client ID for the client app | |
| $clientId = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" | |
| $resourceAppIdURI = "https://TestWebApi01.azurewebsites.net" | |
| $authority = "https://login.windows.net/MyAadDirectory.onmicrosoft.com" | |
| # Create Authentication Context tied to Azure AD Tenant | |
| $authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority |
This file contains hidden or 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
| #Create the cert | |
| New-SelfSignedCertificate -DnsName 'foo.azurewebsites.net' -CertStoreLocation cert:\CurrentUser\My -KeyAlgorithm RSA -KeyLength 2048 -KeyExportPolicy Exportable #-KeyUsage DigitalSignature,nonRepudiation,keyEncipherment | |
| #Look for the cert | |
| dir Cert:\CurrentUser\My | |
| #Export the cert to a PFX file | |
| $mypwd = ConvertTo-SecureString -String "WhoFedTheDogCorn?" -Force –AsPlainText | |
| dir Cert:\CurrentUser\My | Where Subject -EQ 'CN=foo.azurewebsites.net' | Export-PfxCertificate -ChainOption BuildChain -Password $mypwd -FilePath E:\Scratch\fooCert.pfx |
This file contains hidden or 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
| ALTER DATABASE MYDB SET RECOVERY SIMPLE | |
| USE MYDB | |
| DBCC SHRINKFILE ('MYDB_LOG', 1) | |
| DBCC SHRINKFILE ('MYDB', 1) |
This file contains hidden or 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
| DECLARE @customerscsv string = "/Data/Meny/postgres_public_customer.csv"; | |
| DECLARE @orderlinescsv string = "/Data/Meny/postgres_public_order_line.csv"; | |
| DECLARE @productscsv string = "/Data/Meny/postgres_public_product.csv"; | |
| DECLARE @orderscsv string = "/Data/Meny/postgres_public_store_order.csv"; | |
| DECLARE @cvsout string = "/Data/Meny/Output/customerorders.csv"; | |
| @customers = | |
| EXTRACT Id int, | |
| FirstName string, |
This file contains hidden or 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
| DECLARE @inputfile string = "/Data/Meny/postgres_public_customer.csv"; | |
| DECLARE @cvsout string = "/Data/Meny/Output/ourcustomers.csv"; | |
| DECLARE @tsvout string = "/Data/Meny/Output/ourcustomers.tsv"; | |
| DECLARE @txtout string = "/Data/Meny/Output/ourcustomers.txt"; | |
| @customers = | |
| EXTRACT UserId int, | |
| FirstName string, | |
| LastName string, |
This file contains hidden or 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
| DECLARE @inputfile string = "/Data/Meny/postgres_public_customer.csv"; | |
| DECLARE @cvsout string = "/Data/Meny/Output/ourcustomers2.csv"; | |
| DECLARE @tsvout string = "/Data/Meny/Output/ourcustomers2.tsv"; | |
| DECLARE @txtout string = "/Data/Meny/Output/ourcustomers2.txt"; | |
| @customers = | |
| EXTRACT UserId int, | |
| FirstName string, | |
| LastName string, | |
| Address string, |
This file contains hidden or 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
| DECLARE @customerordersinput string = "/Data/Meny/Output/customerorders.csv"; | |
| DECLARE @cvsout string = "/Data/Meny/Output/top5buyers.csv"; | |
| @customersorders = | |
| EXTRACT CustomerId int, | |
| CustomerFirstName string, | |
| CustomerLastName string, | |
| ProductName string, | |
| ProductPrice int, |
This file contains hidden or 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
| Function Test-DownloadUri { | |
| <# | |
| .SYNOPSIS | |
| Tests that a url is valid | |
| .DESCRIPTION | |
| Returns a status code from an http request of a url. Used to verify that download links work. | |
| .PARAMETER Uri | |
| The url that we are checking is valid | |
| .INPUTS | |
| N/A |
This file contains hidden or 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
| \n | |
| Timing information\n | |
| ==================\n | |
| *time_appconnect The time it took from the start until the SSL/SSH/etc connect/handshake to the remote host was completed.\n | |
| *time_connect The time it took from the start until the TCP connect to the remote host (or proxy) was completed.\n | |
| *time_namelookup The time it took from the start until the name resolving was completed.\n | |
| *time_pretransfer The time it took from the start until the file transfer was just about to begin.\n | |
| *time_redirect The time it took for all redirection steps including name lookup, connect, pretransfer and transfer.\n | |
| *time_starttransfer The time it took from the start until the first byte was just about to be transferred.\n | |
| *time_total The total time that the full operation last\n |