Setup Profile Started
This commit is contained in:
parent
b26bd9392b
commit
12d828c75e
9
CopyFromFile.txt
Normal file
9
CopyFromFile.txt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
|
||||||
|
param($wordToComplete, $commandAst, $cursorPosition)
|
||||||
|
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
|
||||||
|
$Local:word = $wordToComplete.Replace('"', '""')
|
||||||
|
$Local:ast = $commandAst.ToString().Replace('"', '""')
|
||||||
|
winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object {
|
||||||
|
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
||||||
|
}
|
||||||
|
}
|
12
README.md
12
README.md
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
## About "Project" ##
|
## About "Project" ##
|
||||||
|
|
||||||
Little PowerShell script that installs most of the windows programs I use
|
Little PowerShell script that installs most of the windows programs I use.
|
||||||
|
Working on getting it to setup more of the env as well
|
||||||
|
|
||||||
based on:
|
based on:
|
||||||
|
|
||||||
@ -10,6 +11,10 @@ based on:
|
|||||||
* <https://gist.github.com/Codebytes/29bf18015f6e93fca9421df73c6e512c>
|
* <https://gist.github.com/Codebytes/29bf18015f6e93fca9421df73c6e512c>
|
||||||
* <https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901>
|
* <https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901>
|
||||||
|
|
||||||
|
Shoutout to:
|
||||||
|
[ankokudaishogun](https://www.reddit.com/user/ankokudaishogun/) for being a
|
||||||
|
HUGE help
|
||||||
|
|
||||||
## Usage ##
|
## Usage ##
|
||||||
|
|
||||||
### FIRST ###
|
### FIRST ###
|
||||||
@ -23,3 +28,8 @@ PowerShell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.
|
|||||||
```
|
```
|
||||||
|
|
||||||
You'll get 5 menu options. Use the ones that make sense.
|
You'll get 5 menu options. Use the ones that make sense.
|
||||||
|
|
||||||
|
## Planned Features ##
|
||||||
|
|
||||||
|
Install NFS Client features
|
||||||
|
Map my typical network driver?
|
||||||
|
34
setup.ps1
34
setup.ps1
@ -31,6 +31,8 @@ $settingsJson = @{installBehavior = @{
|
|||||||
}
|
}
|
||||||
$settingsJson | ConvertTo-Json | Out-File $settingsPath -Encoding utf8
|
$settingsJson | ConvertTo-Json | Out-File $settingsPath -Encoding utf8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function InstallTheApps() {
|
function InstallTheApps() {
|
||||||
Foreach ($app in $apps) {
|
Foreach ($app in $apps) {
|
||||||
$listApp = winget list --exact -q $app.name
|
$listApp = winget list --exact -q $app.name
|
||||||
@ -52,6 +54,31 @@ function InstallTheApps() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function Update-Profile {
|
||||||
|
if (-not (Test-Path $PROFILE)) { $null = New-Item -Force $PROFILE }
|
||||||
|
if (-not (Test-Path ./CopyFromFile.txt)) {iex ((New-Object System.Net.WebClient).DownloadString('https://git.theflyingfool.com/theflyingfool/Win_Setup/raw/branch/main/CopyFromFile.txt'))}
|
||||||
|
# Get-Content -Path $PROFILE
|
||||||
|
Get-Content -Path .\CopyFromFile.txt | Add-Content -Path $PROFILE
|
||||||
|
# Get-Content -Path $PROFILE
|
||||||
|
|
||||||
|
#>
|
||||||
|
<#
|
||||||
|
Write-Output '
|
||||||
|
|
||||||
|
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
|
||||||
|
param($wordToComplete, $commandAst, $cursorPosition)
|
||||||
|
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
|
||||||
|
$Local:word = $wordToComplete.Replace('"', '""')
|
||||||
|
$Local:ast = $commandAst.ToString().Replace('"', '""')
|
||||||
|
winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object {
|
||||||
|
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}' >> $PROFILE
|
||||||
|
|
||||||
|
#>
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
$answer = $null
|
$answer = $null
|
||||||
do {
|
do {
|
||||||
@ -79,7 +106,7 @@ do {
|
|||||||
|
|
||||||
|
|
||||||
switch ( $answer ) {
|
switch ( $answer ) {
|
||||||
"1" { $apps = @( # BASE APPS
|
"1" { $apps = @( # BASE APPS
|
||||||
@{name = 'Microsoft.PowerShell' },
|
@{name = 'Microsoft.PowerShell' },
|
||||||
@{name = 'Microsoft.VisualStudioCode' },
|
@{name = 'Microsoft.VisualStudioCode' },
|
||||||
@{name = 'Microsoft.WindowsTerminal'},
|
@{name = 'Microsoft.WindowsTerminal'},
|
||||||
@ -102,7 +129,10 @@ do {
|
|||||||
@{name = 'Microsoft.Office' },
|
@{name = 'Microsoft.Office' },
|
||||||
@{name = 'Malwarebytes.Malwarebytes '}
|
@{name = 'Malwarebytes.Malwarebytes '}
|
||||||
)
|
)
|
||||||
InstallTheApps $Apps
|
|
||||||
|
InstallTheApps $Apps
|
||||||
|
Update-Profile
|
||||||
|
|
||||||
}
|
}
|
||||||
"2" {
|
"2" {
|
||||||
$apps = @( # Game Launchers
|
$apps = @( # Game Launchers
|
||||||
|
Loading…
Reference in New Issue
Block a user