Various shell scripts for use on the RTC server. Not your official RTC stuff!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

22 lines
490 B

#
# jot.ps1
# author: sam hunter
#
$jotpath = "S:\\shared"
function NewJot() {
$jot=Read-Host -Prompt "Jot"
if ($jot.Length -gt 0) {
$user=$env:USERNAME
$ts=(Get-Date -UFormat "%Y-%m-%d %H:%M:%S")
Add-Content -Path "$jotpath/jot-$user.txt" -Value "$ts`t$user`t$jot"
}
}
function DumpJots(){
Import-Csv -Delimiter "`t" -Path "$jotpath\jot-*.txt" -Header Time,Author,Content -ErrorAction Stop |
Sort-Object -Property Time|
Select -First 20 | Format-List
}
DumpJots; NewJot