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
#requires -version 5 | |
<# | |
.SYNOPSIS | |
High Performance Powershell Module Installation | |
.DESCRIPTION | |
This is a proof of concept for using the Powershell Gallery OData API and HTTPClient to parallel install packages | |
It is also a demonstration of using async tasks in powershell appropriately. Who says powershell can't be fast? | |
This drastically reduces the bandwidth/load against Powershell Gallery by only requesting the required data | |
It also handles dependencies (via Nuget), checks for existing packages, and caches already downloaded packages |
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
function Wait-LogLine | |
{ | |
<# | |
.SYNOPSIS | |
Waits for lines in log files matching a pattern. | |
.DESCRIPTION | |
This command blocks, reading a file until a line appears that matches a pattern. If the | |
line matches the pattern, the entire line is written to the output stream. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Relay circuit design & spec for domestic electrical heating | |
============================================ | |
I have multiple Tado Smart Thermostats, model RU01, and multiple rooms with electrical underfloor heating. I require a power-switching circuit for the heating. | |
The heating in the largest room has a resistance of ~14 ohms and should run at 230VAC (I'm in the UK). All other rooms have higher resistance. This is a purely resistive load. | |
Tado do not provide great datasheets, but they have three pins for simple NO/NC/COM. I found a downloadable user guide at http://www.free-instruction-manuals.com/pdf/pa_1184164.pdf which states: | |
- Relay: max. 240V AC 6(4)A / max. 36V DC 6(4)A |
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
<?xml version="1.0" encoding="utf-8"?> | |
<key name="Software"> | |
<key name="ConEmu"> | |
<key name=".Vanilla" modified="2019-02-01 21:41:26" build="180626"> | |
<value name="StartType" type="hex" data="02"/> | |
<value name="CmdLine" type="string" data=""/> | |
<value name="StartTasksFile" type="string" data=""/> | |
<value name="StartTasksName" type="string" data="{Shells::PowerShell}"/> | |
<value name="StartFarFolders" type="hex" data="00"/> | |
<value name="StartFarEditors" type="hex" data="00"/> |
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
$Frames = (@( | |
" <br> <br> <br> :r:. <br> :MBBBBQBv <br> sBBBBQBBBBBQBBBU: <br> 7BQBBBQghIsBbBBBBBQB: <br> iBBBBQBBQMMgQBQBQ7MBQBj <br> |
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
<# | |
When you are roughing out a C# type in powershell, and you don't want to fire up | |
Visual Studio, it can get tiresome having to constantly reload your script editor. | |
This increments the class name each time you compile it. | |
Blogged in https://fsackur.github.io/2018/03/30/Reflecting-on-types/ | |
#> | |
$TypeDef = @' | |
using System; |
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
<# | |
Usage: | |
Get-ClusterName | |
Get-ClusterIpAddress | |
Get-ClusterSqlInstanceName | |
#> | |
#Get all the DNS names used on a cluster | |
function Get-ClusterName { | |
Get-ClusterNode | select @{Name = "ClusterResource"; Expression={"Cluster Node"}}, OwnerGroup, Name, DnsSuffix |
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
<# | |
.Synopsis | |
Provides a mapping of Windows drive letters to WWNs using inq.exe from EMC | |
.Description | |
Gets all volumes in Windows and provides device ID, drive letter and WWN. | |
You must have inq.exe available. | |
.Parameter Path |
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
function Get-DnsCache { | |
<# | |
.Synopsis | |
Get entries from the DNS cache | |
#> | |
$Matches.Clear() | |
$DnsCache = (ipconfig /displaydns) -join "`r`n" | |
$Chunks = $DnsCache -split '\n\s*\r' | |
$Pattern = (New-Object System.Text.StringBuilder). |
NewerOlder