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 global:Get-CompFolder{ | |
param($iFolderLoc) | |
$objCompFolder = [Ordered]@{ | |
'Location' = $iFolderLoc | |
'Folder' = Get-Item $iFolderLoc | |
'SortedTree' = @() | |
} | |
New-Object -TypeName PSObject -Property $objCompFolder | | |
Add-Member -Passthru -Type ScriptProperty -Name Tree -Value { |
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" ?> | |
<!-- ******************************************************************* | |
This is Joel "Jaykul" Bennett's coloring format file for PowerShell 5.1 | |
******************************************************************** --> | |
<Configuration> | |
<SelectionSets> | |
<SelectionSet> | |
<Name>FileSystemTypes</Name> | |
<Types> | |
<TypeName>System.IO.DirectoryInfo</TypeName> |
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 Test-Confirm { | |
[CmdletBinding(SupportsShouldProcess=$true, ConfirmImpact="Medium")] | |
param([Switch]$Force) | |
$RejectAll = $false; | |
$ConfirmAll = $false; | |
Write-Verbose "ConfirmPreference is $ConfirmPreference" | |
foreach($file in ls) { | |
if($PSCmdlet.ShouldProcess( "Removed the file '$($file.Name)'", |
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 "4.0" -Module PackageManagement | |
#requires -Module Configuration | |
#requires -Module Pester | |
[CmdletBinding()] | |
param( | |
# The step(s) to run. Defaults to "Clean", "Update", "Build", "Test", "Package" | |
# You may also "Publish" | |
# It's also acceptable to skip the "Clean" and particularly "Update" steps | |
[ValidateSet("Clean", "Update", "Build", "Test", "Package", "Publish")] | |
[string[]]$Script:Step = @("Clean", "Update", "Build", "Test", "Package"), |
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 Find-Module { | |
<# | |
.Synopsis | |
A wrapper for Invoke-RestMethod to search the PowerShell Gallery | |
.Description | |
In order to support wildcards, we build pretty complicated URLs, | |
and then we filter the results by title | |
#> | |
[CmdletBinding()] | |
param ( |
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.0 | |
using assembly MalmoNet.dll | |
using namespace Microsoft.Research.Malmo | |
[Environment]::CurrentDirectory = $PSScriptRoot | |
$ErrorActionPreference = "Stop" | |
$agentHost = [AgentHost]::new() | |
$mission =[MissionSpec]::new() | |
$missionRecord = [MissionRecordSpec]::new("$PSScriptRoot\saved_data.tgz") |
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 Find-NugetPackage { | |
#.SYNOPSIS | |
# Find a package in a v2 repository | |
[Alias("Find-PSModule")] | |
[CmdletBinding()] | |
param( | |
# The name of a package to find | |
[Parameter(Mandatory)] | |
$Name, | |
# The repository api URL (with trailing slash) -- like https://www.powershellgallery.com/api/v2/ or https://www.nuget.org/api/v2/ |
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
Add-Type -Path C:\Users\JBennett\Source\Repos\SoundUtils\SoundUtils\SoundUtils.cs | |
$volume = [WOSI.Utilities.EndpointVolume]::new() | |
$volume | gm | |
foreach($channel in 0..($volume.GetChannelCount()-1)) { | |
[PSCustomObject]@{Channel = $channel; Volume = $volume.GetChannelVolume($channel) } | |
} | |
$volume.SetChannelVolume(0, 0.5) |
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
# It might work in 4, but I'm not testing there. Lower you'll have to tweak code | |
#requires -Version 5.0 | |
param( | |
# Your Live ID for MSDN login | |
[Parameter(Mandatory)] | |
[PSCredential] | |
[System.Management.Automation.CredentialAttribute()] | |
$Credential, | |
# Pick a browser to use. Defaults to Firefox (which doesn't seem to require an external Driver file) |
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" ?> | |
<Configuration> | |
<ViewDefinitions> | |
<View> | |
<Name>history</Name> | |
<ViewSelectedBy> | |
<TypeName>Microsoft.PowerShell.Commands.HistoryInfo</TypeName> | |
</ViewSelectedBy> | |
<TableControl> | |
<TableHeaders> |