forked from EvzenP/STraSAK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TS2022.cmd
33 lines (27 loc) · 1.49 KB
/
TS2022.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<# : ----------------- begin batch part -----------------
@echo off
:: get Documents folder location from registry
for /f "tokens=2*" %%A in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" 2^>nul') do call set "DocumentsFolder=%%B"
:: add Modules location to PSModulePath variable
set "PSModulePath=%DocumentsFolder%\WindowsPowerShell\Modules\;%PSModulePath%"
:: PowerShell location
set POWERSHELL=%windir%\system32\WindowsPowerShell\v1.0\powershell.exe
:: use 32-bit version on 64-bit systems!
if exist "%windir%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" (set POWERSHELL=%windir%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe)
:: from http://www.dostips.com/forum/viewtopic.php?f=3&t=5526&start=15#p45502
:: invoke embedded PowerShell code + code specified on command line
setlocal enabledelayedexpansion
set _args=%*
rem this is to prevent PS errors if launched with empty command line
if not defined _args set "_args= "
set _args=!_args:'=''!
set _args=!_args:"="""!
type "%~f0" | %POWERSHELL% -NoLogo -NoProfile -ExecutionPolicy Bypass -Command "%POWERSHELL% -NoLogo -NoProfile -ExecutionPolicy Bypass -Command ([ScriptBlock]::Create([Console]::In.ReadToEnd()+';!_args!'))"
endlocal
exit /b 0
----------------- end batch part ----------------- #>
[cultureinfo]::DefaultThreadCurrentCulture = 'en-US'
# import SDL Powershell Toolkit modules
$StudioVersion = "Studio17"
$Module = "DependencyLoader"
Import-Module -Name $Module -ArgumentList $StudioVersion