Skip to content

Instantly share code, notes, and snippets.

@karino2
Last active February 26, 2017 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karino2/34337e46c51f6ec1cac55b1746113968 to your computer and use it in GitHub Desktop.
Save karino2/34337e46c51f6ec1cac55b1746113968 to your computer and use it in GitHub Desktop.
PowerShell script of bookmark for editbook
filter fifi {
$drv = $_.substring(0, 2)
$splits = $_.substring(2).split(":")
if ($splits.length -eq 1) {
$_
} else {
$drv + $splits[0]
}
}
function fio {
$target = $input | fifi | select-object -first 1
ebclient $target
}
$g_bookmark_path = "C:\Users\karino2\home.txt"
function book {
if ($args.Length -eq 0) {
cat $g_bookmark_path;
return;
}
$pat = $args[0];
cat $g_bookmark_path | ?{ $_ -match $pat}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment