PowerShell: $PSScriptRoot…

$PSScriptRoot returns the parent of the current script/invocation.

This summarises:

Write-Output "1.`$PSScriptRoot:[$PSScriptRoot]"
Write-Output "2.Parent:[$(Split-Path -Parent $MyInvocation.MyCommand.Path)]"
Write-Output "3.Leaf:[$(Split-Path -Leaf $MyInvocation.MyCommand.Path)]"
Write-Output "4.Full path:[$($MyInvocation.MyCommand.Path)]"

 

Advertisements

GitHub: searching in your own repositories

While not immediately apparent to me, GitHub does have pretty good search. The root URL is, amazingly:

https://github.com/search

Also here in a new tab.

One example is enough, as the GitHub URL gives more detail. Note the syntax used is:

[search string](space)[literal "user:"][repo owner to search]

, as in:

Also note that you don’t seem able to enter wildcards…

Pretty much confirmed by this:

OK Google commands

  • OK Google (seems to activate more easily if you “train” it in Android)
    • Text [Jan mobile]
    • Call [Jan mobile]
    • get to [Slough]([by car] | [by bike])
    • Bluetooth [off|on]
    • Wi-Fi [off|on]
    • Wake me up in [3] minutes
    • Wake me up at [7 oh 2] am
    • Remind me to [buy milk] at [5 PM]
    • Where’s the closest [Caffe Nero]
    • What is my schedule for tomorrow
    • What is my schedule

Links

http://trendblog.net/list-of-google-now-voice-commands-infographic/

http://www.greenbot.com/article/2359684/android/a-list-of-all-the-ok-google-voice-commands.html

 

 

 

 

 

 

 

PowerShell: AVI to mp4 conversion, and related

I’ve been using Handbrake CLI wrapped in PowerShell to convert some bulky old AVI files to MP4, and then to copy those to DVD for another layer of backup.

Some scripts here, here, here and here.

I have just finished a pretty extensive repo and Wiki on this subject, on GitHub, here. The intended audience for this is those who can find their way around Windows, but who know nothing about PowerShell.

I’ve now made a video here to illustrate just the AVI to mp4 conversion part.

PSAndHandbrake01