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 | |
Show GUI Messagebox | |
.DESCRIPTION | |
Show GUI Messagebox and wait for user input or timeout | |
.PARAMETER Message | |
Message to show | |
.PARAMETER Title | |
Messagebox title | |
.PARAMETER Buttons |
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 | |
Sony Camera XML to DVDT converter | |
.DESCRIPTION | |
Sony Camera XML to DVDT converter | |
.EXAMPLE | |
PS C:\> Convert-Xml2Dvdt.ps1 D:\C0007M01.XML | |
Convert D:\C0007M01.XML to D:\C0007M01.DVDT | |
date: 07/08/2020 16:31:47 duration: 336 fps: 25 | |
.EXAMPLE |
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
#!/usr/bin/env ruby | |
require 'faraday' | |
require 'json' | |
require 'gitlab' | |
module Redmine | |
Host = nil | |
APIKey = nil |
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 | |
Install MSI package by copy-run-remove | |
.DESCRIPTION | |
Install MSI package by copy-run-remove | |
.PARAMETER ComputerName | |
Remote computer name | |
.PARAMETER MSI | |
Path to msi package | |
.NOTES |
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
# Needed DotNetZip.dll from https://github.com/haf/DotNetZip.Semverd | |
# in script directory | |
param( | |
$inputPath, | |
$outputPath, | |
$ArchivePrefix = 'Arch', | |
$days = 7 | |
) | |
$inputpath = $inputpath -replace '\\$' # remove trailing \ |
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 Set-LocalGroupMember { | |
[CmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='High')] | |
param( | |
[Parameter(ValueFromPipeline=$true, Position=0)] | |
[string[]]$ComputerName = '.', | |
[Parameter(ValueFromPipeline=$false, Position=1)] | |
[string[]]$GroupName = 'Administrators', | |
[Parameter(ValueFromPipeline=$false, Position=2)] | |
[string]$Member, | |
[Parameter(Mandatory=$true, ParameterSetName='remove')] |
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 | |
Generate set of passwords | |
.DESCRIPTION | |
Generate set of passwords based on character usage rules | |
.OUTPUTS | |
Array of string | |
.PARAMETER Length | |
The password length | |
.PARAMETER Count |
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
var wsh = WScript.CreateObject("WScript.Shell") | |
// | |
// Pin item from command line to taskbar// | |
function PinToTaskbar(program) { | |
program = wsh.ExpandEnvironmentStrings(program); | |
var fp = program.split("\\"); | |
var name = fp.pop() | |
var path = fp.join('\\') | |
var shap = WScript.CreateObject("Shell.Application"); | |
var fld = shap.Namespace(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
$here = Split-Path -Parent $MyInvocation.MyCommand.Path | |
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' | |
. "$here\$sut" | |
Describe "Test RSJob Throttling" { | |
It "Full Pipe input" { | |
$StartDate = Get-Date | |
Test-RSJob $true | |
$EndDate = Get-Date | |
( $EndDate - $StartDate ).TotalSeconds -gt 25 | Should be $True |
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-RSJob([bool]$FullPiping=$true) { | |
$ScriptBlock = { "{0}: {1}" -f $_, [DateTime]::Now; Start-Sleep -Seconds 5 } | |
$params = @{ Batch='throttletest'; ScriptBlock=$ScriptBlock; Throttle=5 } | |
if ($FullPiping) { | |
$jobs = 1..25 | Start-RSJob @params | |
} | |
else { | |
$jobs = 1..25 | Foreach-Object { $_ | Start-RSJob @params } | |
} | |
$jobs | Wait-RSJob | Receive-RSJob |