1 #WebDriverException: Message: unknown error: cannot determine loading status .EXAMPLE
2 # . C:\src\dotfiles\Microsoft.PowerShell_profile.ps1
5 # Get-ChildItem -Path 'C:\Repos' -Filter "*.psd1" -Recurse | ForEach-Object -Process {
6 # $Path = Split-Path -Path $_.Directory -Parent
7 # $env:PSModulePath = $env:PSModulePath + ";$($Path)"
9 # $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'')
11 function Add-ToProfile {
15 $profileContents = [string]::join([environment]::newline, (get-content -path $Path))
16 invoke-expression $profileContents
25 Add-ToProfile $env:src\dotfiles\files\paths.ps1
26 $env:todolist = "C:\Users\delaport\Journal\"
27 # New-Alias todo todolist
29 # alias renumber $HOME/src/x16-demo/
31 $env:Journal = "~\Journal" # allows cd $env:journal
32 # $env:minion = "$env:src\minion"
34 # Import some home grown PowerShell modules, if they are installed.
36 $modPaths = Get-Childitem -ErrorAction Ignore -Path "$env:src\dotfiles\psmodules"
37 # $modPaths += Get-Childitem -ErrorAction Ignore -Path "$env:minion\psmodule"
39 # https://github.com/uillinois-community/powershell-scripts
40 # $modPaths += Get-Childitem -ErrorAction Ignore -Path "$env:src\powershell-scripts\modules"
42 # Windows Only Modules
44 # $modPaths += Get-Childitem -ErrorAction Ignore -Path "$env:src\dotfiles\win_psmodules"
46 # if($modPaths.length -eq 0){
47 # Write-Host "No modules found."
50 # $enabledMods = 'dash.psm1','docker.psm1';
51 # $modPaths | ForEach-Object {
52 # $fileName = $_.FullName
53 # if($enabledModules -Contains $_.Name ){
54 # if($filename -Like "*.psm1") {
55 # Import-Module $fileName
56 # Write-Host ">> Loaded $fileName"
63 # Linux-like up/down in shell
64 Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
65 Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
66 Set-PSReadlineOption -HistorySavePath $env:src\PSHistory.log
68 # Minion alias commands - 'today'
69 # . C:\src\minion\profiles\alias.ps1
70 # . $env:minion\profiles\alias.ps1
71 # Add Minion go executable to path.
72 # . $env:minion\profiles\path.ps1
74 # Write-Host "+ Added minion command to path."
76 # $ENV:PATH+=";$env:minion\go" # Flag to ensure my profile kicked in.
80 New-Alias which get-command
81 # New-Alias rm Remove-Item
83 # Delay loading PoshGit for speed.
84 function Enable-PoshGit {
85 Import-Module posh-git
87 New-Alias pg Enable-PoshGit
88 Write-Host "+ Type 'pg' to enable PoshGit"
90 function Invoke-X16Emu {
94 x16emu.exe -bas $File -keymap en-us
97 New-Alias x16 Invoke-X16Emu
99 if((Get-Location).Path -eq $HOME){
103 function Get-GitLog() {
107 function Get-GitStatus() {
108 git status -b --short
111 # Tell my scripts which GitHub repositories to look in.
112 $env:GITHUB_USERNAME = 'edthedev'
113 $env:GITHUB_REPOS = @(
114 'techservicesillinois/SecOps-Tools',
115 'techservicesillinois/secdev-job-aids',
116 'techservicesillinois/awscli-login',
117 'techservicesillinois/farmit',
118 'uillinois-community/uillinois-community.github.io',
119 'techservicesillinois/SecOps-Powershell-CSOC',
120 'techservicesillinois/SecOps-Powershell-CISDSC',
121 'techservicesillinois/secops-splunk-null-router'
123 $ENV:TS_REPOS = $ENV:GITHUB_REPOS.split(' ') | Where { $_ -like 'techser*' }
127 New-Alias ol Get-GitLog
128 New-Alias st Get-GitStatus
131 New-Alias dash Show-MyDashboard # from dash.psm1
133 function Get-JournalAgenda() {
134 agenda.exe -path "$HOME/Journal/{YYYY}/{MM}-{DD}.md"
136 New-Alias today Get-JournalAgenda
138 function Invoke-FixWslVPN {
139 Get-NetAdapter | Where-Object {$_.InterfaceDescription -Match "Cisco AnyConnect Secure Mobility Client Virtual Miniport Adapter for Windows x64"} | Set-NetIPInterface -InterfaceMetric 6000
142 Write-Host "Real profile file is at $env:realProfile ($$env:realProfile)"