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
# Given a folder with a set of avi files, convert each of those files to mp4 format,in the same folder. | |
# If the target mp4 name already exists, then skip. | |
# Following the conversion the file creation and amendment times get copied from the source/avi to the target/mp4. | |
# And finally, the target name (minus extension) is copied to the clipboard so that you can check the details in Explorer/search. | |
# The rootnames rename the same, only the extension changes. | |
# https://blogs.technet.microsoft.com/heyscriptingguy/2012/06/01/use-powershell-to-modify-file-access-time-stamps/ | |
$currDir = "G:\VideosCollection\TheRest" | |
$handBrakeDir= "C:\temp\HandBrakeCLI-1.0.7-win-x86_64" | |
$logFile = "$currDir/Conversion.$(Get-Random).log" |
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
# Try to copy all named files starting with the biggest to e.g. a DVD | |
# Once less than $minAllowedSpace, exit, in the hope that a bit of contingency on the DVD | |
# makes it easier to read and write files... which are a pain on a DVD writer. | |
#Remove-Item -Path E:\Set1 -Recurse -Force | |
$srcDir = "G:\VideosCollection\TheRest\MP4" | |
$targetDir = "E:\Set3" | |
$minAllowedSpace = 100mB | |
$set = gci -Path $srcDir -Filter *.mp4 | Sort-Object -Property Length -Descending |
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
# Try to remove all files from a named folder, typically on a DVD | |
#Remove-Item -Path E:\Set1 -Recurse -Force | |
$targetDir = "E:\Set1b" | |
$set = gci -Path $srcDir -Filter *.mp4 | |
$set | % { | |
$file = $_ | |
$baseName = $file.BaseName | |
$target = "$targetDir/$baseName.mp4" |
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
# Compare a reference folder and children, with a copy of that reference | |
$refPath = "G:\VideosCollection\TheRest\MP4" | |
$copyPath = "e:\set3" | |
$refSet = Get-ChildItem -Recurse -path $refPath | |
$copySet = Get-ChildItem -Recurse -path $copyPath | |
Compare-Object -ReferenceObject $refSet -DifferenceObject $copySet |
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 | |
Given a wildcard representing a service logon ("Log On As" in the Windows services grid), | |
find all services executed by that logon, ON THE CURRENT SERVER. | |
.DESCRIPTION | |
As synopsis, plus to use this across a number of VMs, you will have to call this as a script block | |
.PARAMETER UserWildcard |
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
workflow Invoke-PerfCounter { | |
param($counters) | |
foreach -parallel ($counter in $counters) { | |
(Get-Counter $counter).CounterSamples | | |
Select -Property Path, CookedValue } } | |
$counters = | |
'\Processor(*)\% Processor Time', | |
'\Processor(*)\% User Time', | |
'\Process(*)\Handle 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
Next is dennis-rules.js... | |
// Example call: dennisRules.applyRule(currName, results); | |
// The function applyRule always "expects" [v] of 'dennis'. | |
// if [v] is not 'dennis', then it follows convention by populating the callback with an | |
// Error object as the first argument, and leaving the other positions er undefined. | |
// Else ([v] IS 'dennis'), it leaves the first argument as null (again, following convention), | |
// and populates argument 2 with the input [v] value, and argument 3 with the random period to | |
// wait before returning. | |
// For the function to be available to callers, we call module.exports.(function name) = (function 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
//i.js | |
'use strict'; | |
console.log('Loading function'); | |
exports.handler = (event, context, callback) => { | |
console.log('Received event:', JSON.stringify(event, null, 2)); | |
console.log('value1x =', event.key1); | |
console.log('value2x =', event.key2); | |
console.log('value3x =', event.key3); |
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
{ | |
"Print to console": { | |
"prefix": "dw-testlambdajs-example", | |
"body": [ | |
"'use strict';", | |
"// Package imports...", | |
"const LambdaTester = require('lambda-tester');", | |
"const expect = require('chai').expect;", | |
"", | |
"// Local helpers...", |
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
<UserSettings><ApplicationIdentity version="15.0"/><ToolsOptions><ToolsOptionsCategory name="Environment" RegisteredName="Environment"><ToolsOptionsSubCategory name="Documents" RegisteredName="Documents" PackageName="Visual Studio Environment Package"><PropertyValue name="ShowMiscFilesProject">false</PropertyValue><PropertyValue name="AutoloadExternalChanges">false</PropertyValue><PropertyValue name="CheckForConsistentLineEndings">true</PropertyValue><PropertyValue name="SaveDocsAsUnicodeWhenDataLoss">false</PropertyValue><PropertyValue name="InitializeOpenFileFromCurrentDocument">true</PropertyValue><PropertyValue name="ReuseSavedActiveDocWindow">false</PropertyValue><PropertyValue name="DetectFileChangesOutsideIDE">true</PropertyValue><PropertyValue name="DontShowGlobalUndoChangeLossDialog">true</PropertyValue><PropertyValue name="AllowEditingReadOnlyFiles">true</PropertyValue><PropertyValue name="DocumentDockPreference">0</PropertyValue><PropertyValue name="MiscFilesProjectSavesLastNItems">0</PropertyValue |
OlderNewer