Skip to content

Instantly share code, notes, and snippets.

@izharikov
Last active August 23, 2019 08:49
Show Gist options
  • Save izharikov/a08da74ae10e599aa1e8f550416a199f to your computer and use it in GitHub Desktop.
Save izharikov/a08da74ae10e599aa1e8f550416a199f to your computer and use it in GitHub Desktop.
Configure Dev VM
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install totalcommander -y
choco install emeditor -y --allow-empty-checksums
choco install conemu -y
choco install visualstudio2019community -y
choco install vscode -y
choco install jetbrains-rider -y
choco install git -params '"/GitAndUnixToolsOnPath"'
# Create desktop shortcut
function CreateShortcut{
param(
$Source,
$LinkName
)
$SourceFileLocation = $Source
$ShortcutLocation = "C:\Users\vagrant\Desktop\$LinkName.lnk"
#New-Object : Creates an instance of a Microsoft .NET Framework or COM object.
#-ComObject WScript.Shell: This creates an instance of the COM object that represents the WScript.Shell for invoke CreateShortCut
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutLocation)
$Shortcut.TargetPath = $SourceFileLocation
#Save the Shortcut to the TargetPath
$Shortcut.Save()
}
CreateShortcut -Source "$env:SystemRoot\System32\InetSrv\InetMgr.exe" -LinkName "IIS"
CreateShortcut -Source "C:\Program Files\totalcmd\TOTALCMD.EXE" -LinkName "Total Commander"
CreateShortcut -Source "C:\Program Files\EmEditor\EmEditor.exe" -LinkName "EmEditor"
CreateShortcut -Source "C:\Program Files\ConEmu\ConEmu64.exe" -LinkName "ConEmu"
CreateShortcut -Source "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" -LinkName "Visual Studio 2019"
CreateShortcut -Source "C:\Program Files (x86)\JetBrains\JetBrains Rider 2019.2.1\bin\rider64.exe" -LinkName "JetBrains Rider"
choco install totalcommander -y --allow-empty-checksums
choco install emeditor -y --allow-empty-checksums
# Create desktop shortcut
function CreateShortcut{
param(
$Source,
$LinkName
)
$SourceFileLocation = $Source
$ShortcutLocation = "C:\Users\vagrant\Desktop\$LinkName.lnk"
#New-Object : Creates an instance of a Microsoft .NET Framework or COM object.
#-ComObject WScript.Shell: This creates an instance of the COM object that represents the WScript.Shell for invoke CreateShortCut
$WScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WScriptShell.CreateShortcut($ShortcutLocation)
$Shortcut.TargetPath = $SourceFileLocation
#Save the Shortcut to the TargetPath
$Shortcut.Save()
}
CreateShortcut -Source "$env:SystemRoot\System32\InetSrv\InetMgr.exe" -LinkName "IIS"
CreateShortcut -Source "C:\Program Files\totalcmd\TOTALCMD.EXE" -LinkName "Total Commander"
CreateShortcut -Source "C:\Program Files\EmEditor\EmEditor.exe" -LinkName "EmEditor"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment