Add windows PBA

This commit is contained in:
Shreya 2020-06-15 17:44:28 +05:30
parent 3fe4dd679b
commit 1b040dc874
1 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,12 @@
SHELL_STARTUP_FILE = '$Profile'
def get_windows_commands_to_modify_shell_startup_files():
# TODO: add for powershell
return 'dir'
return [
'powershell.exe', # run with powershell
'Add-Content {0} '.format(SHELL_STARTUP_FILE),
'\"# Successfully modified {0}\" ;'.format(SHELL_STARTUP_FILE), # add line to $profile
'cat {0} | Select -last 1 ;'.format(SHELL_STARTUP_FILE), # print last line of $profile
'$OldProfile = cat {0} | Select -skiplast 1 ;'.format(SHELL_STARTUP_FILE),
'Set-Content {0} -Value $OldProfile ;'.format(SHELL_STARTUP_FILE) # remove last line of $profile
]