Created
October 28, 2018 23:14
-
-
Save phosphore/1abb95a1c32d720a191decfb2ea8fda6 to your computer and use it in GitHub Desktop.
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
# Determine where to do the logging | |
$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment | |
$logPath = $tsenv.Value("LogPath") | |
$logFile = "$logPath\$($myInvocation.MyCommand).log" | |
# Start the logging | |
Start-Transcript $logFile | |
Write-Host "Logging to $logFile" | |
# Main code | |
$Shell = New-Object -ComObject ("WScript.Shell") | |
$ShortCut = $Shell.CreateShortcut("C:\Users\Default\Desktop\Shortcut.lnk") | |
$ShortCut.TargetPath="https://www.google.com" | |
$ShortCut.WindowStyle = 1; | |
$ShortCut.IconLocation = "C:\Program Files\internet explorer\iexplore.exe, 0"; | |
$ShortCut.Description = "Shortcut Description"; | |
$ShortCut.Save() | |
# Stop logging | |
Stop-Transcript |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment