Setup Profile Started

This commit is contained in:
TheFlyingFool 2024-05-14 15:06:11 -05:00
parent b26bd9392b
commit 12d828c75e
3 changed files with 52 additions and 3 deletions

9
CopyFromFile.txt Normal file
View 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', $_)
}
}

View File

@ -2,7 +2,8 @@
## 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:
@ -10,6 +11,10 @@ based on:
* <https://gist.github.com/Codebytes/29bf18015f6e93fca9421df73c6e512c>
* <https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901>
Shoutout to:
[ankokudaishogun](https://www.reddit.com/user/ankokudaishogun/) for being a
HUGE help
## Usage ##
### 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.
## Planned Features ##
Install NFS Client features
Map my typical network driver?

View File

@ -31,6 +31,8 @@ $settingsJson = @{installBehavior = @{
}
$settingsJson | ConvertTo-Json | Out-File $settingsPath -Encoding utf8
function InstallTheApps() {
Foreach ($app in $apps) {
$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 {
$answer = $null
do {
@ -79,7 +106,7 @@ do {
switch ( $answer ) {
"1" { $apps = @( # BASE APPS
"1" { $apps = @( # BASE APPS
@{name = 'Microsoft.PowerShell' },
@{name = 'Microsoft.VisualStudioCode' },
@{name = 'Microsoft.WindowsTerminal'},
@ -102,7 +129,10 @@ do {
@{name = 'Microsoft.Office' },
@{name = 'Malwarebytes.Malwarebytes '}
)
InstallTheApps $Apps
InstallTheApps $Apps
Update-Profile
}
"2" {
$apps = @( # Game Launchers