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
New-VM -name WADK -memoryStartupBytes 750MB -generation 2 -newVHDPath b:\VMs\wadk.vhdx -newVHDSizeBytes 25GB -bootDevice VHD | |
Add-VMDvdDrive WADK | |
Start-Sleep -seconds 5 | |
$ws2016ISO = "D:\ISOs\Windows Server 2016\Microsoft Windows Server 2016 Version 1607 Build 10.0.14393.447 Updated Jan 2017 VLSC\SW_DVD9_Win_Svr_STD_Core_and_DataCtr_Core_2016_64Bit_English_-3_MLF_X21-30350.ISO" | |
Set-VMDvdDrive -VMName WADK -path $ws2016ISO -toControllerNumber 0 -toControllerLocation 1 | |
Start-Sleep -Seconds 5 |
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
"w:\ISOs\windows10\1803\17004\install.wim", | |
"w:\ISOs\windows10\1703\release\install.wim", | |
"w:\ISOs\windowsServer2016\WinSrv2016StdUpdate2017Sep.iso" | %{ | |
imagex /apply $_ 1 |
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 Install-Scoop { | |
New-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" ` | |
-propertyType ExpandString ` | |
-name "SCOOP_GLOBAL" ` | |
-value "${ENV:PROGRAMDATA}\scoop" | |
Invoke-WebRequest 'https://get.scoop.sh' | Invoke-Expression | |
'scoop install Git-with-OpenSSH Sudo Which --global' | Set-Content -path temp_script.ps1 |
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
# result: https://runkit.io/turbobasic/dotnettimezones/branches/master | |
[System.TimeZoneInfo]::GetSystemTimeZones() | | |
Select -property Id, @{ Name = 'BaseUtcOffsetHours'; Expression = {$_.BaseUtcOffset.TotalMinutes / 60} } |
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 | |
Get the latest Cumulative update for Windows | |
.DESCRIPTION | |
This script will return the list of Cumulative updates for Windows 10 and Windows Server 2016 from the Microsoft Update Catalog. | |
.NOTES | |
Copyright Keith Garner ([email protected]), All rights reserved. |
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 Find-Path { | |
<# | |
.EXAMPLE | |
Find-Path -path @('hgjf', '.', $null) | |
.EXAMPLE | |
Get-ChildItem . -recurse -filter *.ps1 | Find-Path | |
.EXAMPLE | |
'**/*.txt', (Get-ChildItem . -recurse) | Find-Path -ExcludeDirectory |
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 Find-FunctionSimple { | |
Param( | |
[Parameter( Mandatory )] | |
[AllowEmptyString()] | |
[String] | |
$Text | |
) | |
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 Find-Function { | |
[CmdletBinding()] | |
Param( | |
[Parameter( Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName )] | |
[Object[]] | |
[Alias( 'FullName' )] | |
$Path | |
) |
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 3 | |
#Requires -Modules Posh-Gist | |
function Get-GistFiles { | |
<# | |
.SYNOPSIS | |
Gets list of files inside the GitHub gists of a user | |
.DESCRIPTION | |
Gets list of files inside the GitHub gists of a user. GitHub API is not very convenient |
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 New-AdhocModule { | |
# | |
# .SYNOPSIS | |
# Creating Module based on all .ps1 files in specified directories | |
# | |
# .EXAMPLE | |
# New-AdhocModule -Path c:\ProgramData\Chocolatey\helpers\functions -Module ChocoTools | |
# | |
[CmdletBinding( |