-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpowershell-pc-setup.bat
More file actions
22 lines (17 loc) · 951 Bytes
/
powershell-pc-setup.bat
File metadata and controls
22 lines (17 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
@ECHO EXECUTION POLICY MUST BE SET TO SOMETHING OTHER THAN AllSigned FOR THIS
@ECHO SCRIPT TO WORK. e.g. Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
SET oneDriveWinPowerShellProfile=%OneDriveConsumer%\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
SET userDocsFolder=%UserProfile%\Documents
SET userWinPowerShellProfile=%userDocsFolder%\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
IF NOT EXIST "%userDocsFolder%\WindowsPowerShell" mkdir "%userDocsFolder%\WindowsPowerShell"
IF NOT EXIST "%userWinPowerShellProfile%" (
mklink "%userWinPowerShellProfile%" "%oneDriveWinPowerShellProfile%"
)
SET userPowerShellProfile=%userDocsFolder%\PowerShell\Profile.ps1
IF NOT EXIST "%userDocsFolder%\PowerShell" mkdir "%userDocsFolder%\PowerShell"
IF NOT EXIST "%userPowerShellProfile%" (
mklink "%userPowerShellProfile%" "%oneDriveWinPowerShellProfile%"
)
EXIT /b 0