Report Shortcut Properties
When working with a folder that contains several shortcuts, it can be tedious to check the properties of each shortcut. This PowerShell script loops over all of the shortcuts in the folder and reports the name of the executable, start in path, and command line arguments in table format.
$path = Read-Host "Enter the path to search for shortcuts"; Get-ChildItem $path -Filter *.lnk | Select-Object @{Name='Shortcut';Expression={$.Name}}, @{Name='Target';Expression={(New-Object -ComObject WScript.Shell).CreateShortcut($.FullName).TargetPath}}, @{Name='Arguments';Expression={(New-Object -ComObject WScript.Shell).CreateShortcut($.FullName).Arguments}}, @{Name='StartIn';Expression={(New-Object -ComObject WScript.Shell).CreateShortcut($.FullName).WorkingDirectory}} | Format-Table -AutoSize
Who Knows a Mountain?
Who knows a mountain?
Ethel Romig Fuller
One who has gone
To worship its beaty
In the dawn;
One who has slept
On its breast at night;
One who has measured
His strength to its height;
One who has followed
Its longest trail,
And laughed in the face
Of its fiercest gale;
One who has scaled its peaks,
And has trod
Its cloud-swept summits
Alone with Gold.
Springtime Salamanders
Found hiding in the leaves on a hike up the mountain.
PowerShell Tail From Temp File Containing Date
$currentDate = Get-Date -Format "yyyy-MM-ss";
# The file is in the parent temp directory, not the user specific temp directory
$TailFilePath = $env:TEMP + "\..\$currentDate process log usage.txt";
Get-Content -Path $TailFilePath -Wait -Tail 15;