I hereby claim:
- I am steviecoaster on github.
- I am steviecoaster (https://keybase.io/steviecoaster) on keybase.
- I have a public key ASAkTmyMBHZACWCaR9NaOul6cuOhuucZnNnjUZRxXXIqDQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| function Merge-Csv { | |
| <# | |
| .SYNOPSIS | |
| Merge the data from multiple csv files into one | |
| .DESCRIPTION | |
| Merge data from multiple csv files into one. Data from each file should be the same shape | |
| .PARAMETER CsvFile | |
| The path to two or more csv files to combine |
| function New-EncryptedEnvironmentVariable { | |
| <# | |
| .SYNOPSIS | |
| Writes an Environment variable as a secure string using DPAPI | |
| .DESCRIPTION | |
| Writes an Environment variable as a secure string using DPAPI | |
| .PARAMETER Scope | |
| The scope of the variable. Can be machine, user, or process |
Implicit remoting allows you to load a module from a remote session and execute it "locally". What you are actually doing is running a proxy command. The actual function executes on the remote session, and the data is returned to you locally.
This approach does have the same caveats as running a command directly via Invoke-Command in that it is deserialized and rehydrated, losing any available methods on the object.
This is still a hugely useful trick, and I highly recommend using a prefix so you know in your code when something is running on the
remote system. For example Get-ADComputer may become Get-RemoteADComputer. You can specify whatever prefix you want, just make it
| $breeds = @('Labrador','Poodle','St. Bernard','Husky') | |
| 'mut' -in $breeds # false | |
| 'Poodle' -in $breeds #true |
| function Copy-CertToStore { | |
| <# | |
| .SYNOPSIS | |
| Copy a certificate from one store location to another | |
| .DESCRIPTION | |
| Long description | |
| .PARAMETER Certificate | |
| The certificate to copy |
| function New-RandomPass { | |
| <# | |
| .Synopsis | |
| Generates and returns a suitably secure password | |
| .EXAMPLE | |
| New-RandomPass | |
| Returns a random password as a SecureString object | |
| .EXAMPLE |
| #Requires -RunAsAdministrator | |
| #Set our execution policy for the process | |
| Set-ExecutionPolicy Bypass -Scope Process -Force | |
| #Store our packages.config from the gist here temporarily | |
| $tempFile = Join-Path $env:TEMP -ChildPath 'packages.config' | |
| #Write our config file contents | |
| $configFile = 'https://gist.githubusercontent.com/steviecoaster/798bb1046b8fc3275b5a4801cb6f46e4/raw/6e68dbca121276af44ff540c4b6e26df42ee6832/packages.config' |
| Function Get-AllBoundParameters { | |
| [CmdletBinding()] | |
| Param( | |
| # A simple string parameter that is mandatory | |
| [Parameter(Mandatory)] | |
| [String] | |
| $Name, | |
| # A simple switch | |
| [Parameter()] |