🕵️♂️
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
$P = $env:TEMP + '\chrome_installer.exe'; Invoke-WebRequest 'https://dl.google.com/chrome/install/latest/chrome_installer.exe' -OutFile $P; Start-Process -FilePath $P -Args '/silent /install' -Verb RunAs -Wait; Remove-Item $P |
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
[io.file]::Create("$env:temp\reallybigfile-deleteme.txt").SetLength((gwmi Win32_LogicalDisk -Filter "DeviceID='C:'").FreeSpace - 1KB).Close |
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
// This is a comment | |
/* | |
This is a section of comments | |
*/ | |
Console.Read(); //this is an inline comment | |
int aNumber = 0; //declare value type variable | |
//casting | |
float num1 = 20.9; |
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
Get-InstalledModule | Select-Object Name, @{n='Installed';e={$_.Version}}, @{n='Available';e={(Find-Module -Name $_.Name).Version}} | Where-Object {$_.Available -gt $_.Installed} |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Creates an Amazon Route 53 hosted zone | |
Parameters: | |
DomainName: | |
Type: String | |
Description: The DNS name of an Amazon Route 53 hosted zone e.g. jevsejev.io | |
AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-) | |
ConstraintDescription: must be a valid DNS zone name. | |
Resources: | |
DNS: |
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
AWSTemplateFormatVersion: '2010-09-09' | |
Description: Creates an S3 bucket configured for hosting a static website, and a Route | |
53 DNS record pointing to the bucket | |
Parameters: | |
DomainName: | |
Type: String | |
Description: The DNS name of an existing Amazon Route 53 hosted zone e.g. jevsejev.io | |
AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?<!-) | |
ConstraintDescription: must be a valid DNS zone name. | |
FullDomainName: |
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
AWSTemplateFormatVersion: 2010-09-09 | |
Description: > | |
Resources for hosting a static website (generated with Hugo for example) on | |
Amazon Simple Storage Service (S3) & CloudFront. | |
############################################################################### | |
Parameters: | |
############################################################################### | |
AcmCertificateArn: |
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
#--------------------------------------------------------------- | |
# Evaluating if a Parameter Set has been used | |
if ($PSCmdlet.ParameterSetName -eq 'InstanceId') { | |
$target = @{Key = 'instanceids'; Values = $managedInstanceId} | |
} | |
else { | |
$target = @{Key = "tag:$tagName"; Values = $TagValue} | |
} | |
#--------------------------------------------------------------- | |
#controlling multiple dependencies of parameter choices example |
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
#region functions | |
function Convert-PSToVSCodeSnippet { | |
<# | |
.SYNOPSIS | |
Converts PowerShell Code to VSCode snippet format | |
.DESCRIPTION | |
Leverages the ConvertTo-VSCodeSnippet script available on PSGallery to convert PowerShell code to properly formatted VSCode snippet JSON | |
.EXAMPLE | |
Convert-PSToVSCodeSnippet -Name 'MySnippet' -Body $body -Prefix 'MyPrefix' -Description 'MyDescription' |
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
https://github.com/SeeminglyScience/EditorServicesCommandSuite | |
Install-Module EditorServicesCommandSuite -Scope CurrentUser -AllowPrerelease -RequiredVersion 1.0.0-beta4 | |
# Place this in your VSCode profile | |
Import-CommandSuite |