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-Service { | |
[CmdletBinding()] | |
Param( | |
[Parameter( Position = 0, ValueFromPipeline = $True )][String]$Name | |
) | |
Begin { | |
# Stop Function if Not Linux | |
If ( -Not $IsLinux ) { |
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 -Module NameIt | |
while ($true) { | |
$tc = Get-Random -Minimum 1 -Maximum 15 | |
$t = 0 | |
$c=ig "[noun]" | |
Write-Host "`t Context $c" -ForegroundColor Green |
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 -Module NameIt | |
while ($true) { | |
$limit = Get-Random -Minimum 500 -Maximum 4000 | |
$t = 0 | |
$p = 0 | |
$r=ig "[adjective]-[noun]_v#.#.##." | |
$r += @('zip', 'exe', '7zip') | Get-Random | |
while($p -lt 100) { |
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-TargetResource | |
{ | |
[CmdletBinding()] | |
[OutputType([System.Collections.Hashtable])] | |
param | |
( | |
[parameter(Mandatory = $true)] | |
[System.String] | |
$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 ArchitestVolumeHaveSizeRemaining([Microsoft.Management.Infrastructure.CimInstance]$ActualValue, $ExpectedValue, [switch] $Negate) | |
{ | |
$ActualValuePropertyValue = $ActualValue | Select-Object -ExpandProperty SizeRemaining | |
[bool] $succeeded = $ActualValuePropertyValue -gt $ExpectedValue | |
if ($Negate) { $succeeded = -not $succeeded } | |
$failureMessage = '' | |
if (-not $succeeded) |
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
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 14, | |
// font family with optional fallbacks | |
fontFamily: '"Fira Code", monospace', | |
uiFontFamily: '"Fira Code", monospace', |
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 Where-ObjectMaybe | |
{ | |
[CmdletBinding(DefaultParameterSetName='Just')] | |
[Alias('Maybe')] | |
Param | |
( | |
[Parameter(ValueFromPipeline=$true, | |
Position=4)] | |
$InputObject, |
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
. "$PSScriptRoot\attr_common.ps1" | |
class PowerShellExecutable : Executable | |
{ | |
[ExecutableArgument('File')] | |
[string]$File | |
[ExecutableArgument('Password', $true)] | |
[string]$Password |
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
$customData = @{mword = echo money memory music mammoth; dword = echo data drive distance dance dude dog; adverb = echo badly carefully little much worse less more worst least most} | |
$madlib = @" | |
If you want to become [noun] literate, here are some key | |
[noun]s that you should [verb] as quickly as possible: | |
CD ROM: Stands for compact [dword]... read only | |
[mword]. This compact disc can hold as many as 600 | |
[noun]s, which is the equivalent of 700 floppy [noun]s. |
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 map([scriptblock]$map, [Collections.IEnumerable]$x, $y) { $x.ForEach({& $map $_ $y}) } | |
# Two parameters | |
map { param($x, $y) $x + $y } @(1,2,3) 10 | |
# Anonymous function as a value | |
$squareIt = { param($x) $x + $x } | |
map $squareIt @(1,2,3) | |
# One parameter |