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
choco feature enable -n allowGlobalConfirmation | |
cinst Chocolatey | |
cinst azcopy | |
cinst azure-cli | |
cinst azurepowershell | |
cinst sql-server-express | |
cinst sql-server-management-studio | |
cinst powerbi | |
cinst sqlsentryplanexplorer | |
cinst curl |
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
#!/usr/bin/env bash | |
### Bash Environment Setup | |
# http://redsymbol.net/articles/unofficial-bash-strict-mode/ | |
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html | |
# set -o xtrace | |
set -o errexit | |
set -o errtrace | |
set -o nounset | |
set -o pipefail |
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
Class AdvancedPing | |
{ | |
hidden [string]$_packets | |
hidden [string]$_duration | |
hidden [string]$_hostName | |
hidden [string]$_ip | |
hidden [int]$_bytes = 64 | |
hidden [int]$_ttl = 57 | |
hidden [int]$_timeout = 120 | |
hidden [int]$_interval = 1000 |
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
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2) |
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
<# | |
.SYNOPSIS | |
Uses Win32_Fan class to return information about fans in a system. | |
.DESCRIPTION | |
This script first defines some functions to decode various | |
WMI attributed from binary to text. Then the script calls | |
Get-WmiObject to retrieve fan details, then formats that | |
information (using the functions defined at the top of the script. | |
.NOTES |
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
<# | |
.SYNOPSIS | |
Retries a powershell command n-times. | |
.DESCRIPTION | |
The cmdlet is capable of retrying a PowerShell command passed as a [ScriptBlock] according to the user defined number of retries and timeout (In Seconds) | |
.PARAMETER TimeoutInSecs | |
Timeout in secods for each retry. |
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
#requires -version 6.1 | |
Function Send-ToPSGridView { | |
<# | |
.SYNOPSIS | |
Send objects to Out-Gridview in Windows PowerShell | |
.DESCRIPTION | |
This command is intended as a workaround for PowerShell Core running on a Windows platform, presumably Windows 10. PowerShell Core does not support all of the .NET Framework which means some commands like Out-Gridview are not supported. However, on a Windows desktop you are most likely running Windows PowerShell side by side with PowerShell Core. This command is designed to take objects from a PowerShell expression and send it to an instance of Windows PowerShell running Out-Gridview. You can specify a title and pass objects back to your PowerShell Core session. Note that passed objects will be deserialized versions of the original objects. | |
.PARAMETER Title |
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
#requires -version 5.1 | |
#this requires a windows platform | |
Function prompt { | |
$charHash = @{ | |
Up = 0x25b2 -as [char] | |
Down = 0x25bc -as [char] | |
} |
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 prompt { | |
Try { | |
Get-Variable -Name rsHash -Scope global -ErrorAction Stop | Out-Null | |
} | |
Catch { | |
#create the runspace and synchronized hashtable | |
$global:rsHash = [hashtable]::Synchronized(@{Computername = $env:computername; results = ""; date = (Get-Date)}) | |
$newRunspace = [runspacefactory]::CreateRunspace() | |
#set apartment state if available |
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 prompt { | |
Try { | |
Get-Variable -Name rsHash -Scope global -ErrorAction Stop | Out-Null | |
} | |
Catch { | |
#create the runspace and synchronized hashtable | |
$global:rsHash = [hashtable]::Synchronized(@{Computername = $env:computername; results = ""; date = (Get-Date)}) | |
$newRunspace = [runspacefactory]::CreateRunspace() | |
#set apartment state if available |