From b9ec0eb3ba837b370e0336210d9cc22fd245f1f6 Mon Sep 17 00:00:00 2001 From: TheFlyingFool Date: Tue, 14 May 2024 15:56:42 -0500 Subject: [PATCH] No longer getting multiple copies of autocomp text --- setup.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup.ps1 b/setup.ps1 index ecb2ce9..44ad43c 100644 --- a/setup.ps1 +++ b/setup.ps1 @@ -55,10 +55,17 @@ function InstallTheApps() { function Update-Profile { + + #Check For $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'))} + + #Grab "Helper File" + $URL="https://git.theflyingfool.com/theflyingfool/Win_Setup/raw/branch/main/CopyFromFile.txt" + $PATH="$PWD\CopyFromFile.txt" + if (-not (Test-Path ./CopyFromFile.txt)) { (New-Object System.Net.WebClient).DownloadFile($URL, $PATH) } # Get-Content -Path $PROFILE - Get-Content -Path .\CopyFromFile.txt | Add-Content -Path $PROFILE + $CheckString = Get-Content -Path .\CopyFromFile.txt + if (-not(Select-String -Quiet -Path $PROFILE -Pattern $CheckString)) {Get-Content -Path .\CopyFromFile.txt | Add-Content -Path $PROFILE} # Get-Content -Path $PROFILE #>