-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInit.ps1
More file actions
111 lines (92 loc) · 2.22 KB
/
Init.ps1
File metadata and controls
111 lines (92 loc) · 2.22 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<#
.SYNOPSIS
Minimal Initialization Script for Powershell 7 Environment
.DESCRIPTION
.EXAMPLE
pwsh -NoExit -NoLogo -File D:\pwsh-scripts\Init.ps1
.NOTES
Verify defined vars in $PROFILE
Defaulting to old way: change bg color from property for color initialization, using RGB Color:
{1, 28, 64}
Run only for choco init / admin,
Set $Env:ChocolateyInstall, ChocolateyToolsLocation
Deps,
- $PwshScriptDir
- $PFilesX64Dir
- $PFilesX86Dir
#>
# Update repository using libgit2sharp
function UpdateRepo() {
$GitUtilPath = 'D:\Code\CS\GitUtility'
Write-Host -NoNewline "Git Utility: "
dotnet run --project $GitUtilPath pull
# git pull origin master
}
<#
.SYNOPSIS
Settings for Home or Work or any other place to personalize the console UI
.DESCRIPTION
Minimal init for Console UI
.EXAMPLE
InitConsoleUI
#>
function InitConsoleUI() {
(Get-Host).UI.RawUI.WindowTitle = $(if ($PHOST_TYPE -Eq 'office' ) { "Qubit Terminal" } else { "Matrix Terminal" })
}
# Brief help
function ShowHelp() {
Write-Host '
Startx Apps,
- Code
- Signal
Available Shells,
- kotlin
- Pwsh
- SSH
- dotnet
Reg Apps,
- Chrome
- Notepad++
- WinMerge # Code Built In Diff Tool
- KeePass
-- Deprecated or Unused --
- CodeFB
- Vpn connect and disconnect
- Sgdm (DiffMerge)
- DevEnv # Code
- Messenger
- WhatsApp
- Workchat
'
# deprecated from Shells list
# - Meta
}
<#
.SYNOPSIS
The Main Method that calls initialization components
.DESCRIPTION
Modify Env Path
Adding 'C:\Tools' Usually not required: do a cc-certs renewal based on expiration value and the
dialog box for init won't appear to bother us again! Tools is deprecated by
ChocolateyToolsLocation
.EXAMPLE
.\Init
.NOTES
Refs,
- https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet
#>
function Main() {
.\Init-App resetEnvPath
# dotnet parts deprecated in favor of kotlin
Init-App kotlin
# Init-App dotnet
# VS Code requires git. Hence, default now
Init-App git-cmd
'pwsh ' + [string] $PSVersionTable.PSVersion + ' on ' + [string] $PSVersionTable.OS
Write-Host ' '
InitConsoleUI
# TODO: migrate this to kotlin
# UpdateRepo
ShowHelp
}
Main