Typ korrigiert. -e für winget list
This commit is contained in:
18
install.ps1
18
install.ps1
@@ -77,7 +77,7 @@ do {
|
|||||||
}
|
}
|
||||||
# Software installieren.
|
# Software installieren.
|
||||||
foreach ($utility in $toInstall) {
|
foreach ($utility in $toInstall) {
|
||||||
$ergebnis = winget list --id $utility
|
$ergebnis = winget list --id -e $utility
|
||||||
if ($ergebnis -eq "Es wurde kein installiertes Paket gefunden, das den Eingabekriterien entspricht.") {
|
if ($ergebnis -eq "Es wurde kein installiertes Paket gefunden, das den Eingabekriterien entspricht.") {
|
||||||
Try {
|
Try {
|
||||||
winget install -e --id $utility --silent
|
winget install -e --id $utility --silent
|
||||||
@@ -166,7 +166,7 @@ do {
|
|||||||
Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red
|
Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ((Test-Path "~/Documents/WindowsPowerShell/profile.ps1" -PathType Leaf) -eq $True) {
|
if ((Test-Path "~/Documents/WindowsPowerShell/profile.ps1" -PathType Leaf) -eq $True) {
|
||||||
Remove-Item -Force "~/Documents/WindowsPowerShell/profile.ps1"
|
Remove-Item -Force "~/Documents/WindowsPowerShell/profile.ps1"
|
||||||
Write-Host "Powershell config erfolgreich gelöscht." -ForegroundColor Green
|
Write-Host "Powershell config erfolgreich gelöscht." -ForegroundColor Green
|
||||||
Try {
|
Try {
|
||||||
@@ -176,8 +176,20 @@ do {
|
|||||||
Catch {
|
Catch {
|
||||||
Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red
|
Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ((Test-Path "~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1" -PathType Leaf) -eq $True) {
|
||||||
|
Remove-Item -Force "~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1"
|
||||||
|
Write-Host "Powershell config erfolgreich gelöscht." -ForegroundColor Green
|
||||||
|
Try {
|
||||||
|
New-Item -Path "~\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1" -ItemType SymbolicLink -Value "~/.winconfig/profile.ps1" | Out-Null
|
||||||
|
Write-Host "Powershell config erfolgreich verlinkt."
|
||||||
|
}
|
||||||
|
Catch {
|
||||||
|
Write-Host "Probleme beim verlinken der Powershell config." -ForegroundColor Red
|
||||||
|
}
|
||||||
|
}
|
||||||
# Powershell Modul für Updates
|
# Powershell Modul für Updates
|
||||||
|
Write-Host "Beginne mit der Insallation des Powershell Update Modul..." -ForegroundColor Blue
|
||||||
Try {
|
Try {
|
||||||
Install-Module -Name PSWindowsUpdate -Force
|
Install-Module -Name PSWindowsUpdate -Force
|
||||||
Write-Host "Powershell update Modul erfolgreich installiert..." -ForegroundColor Green
|
Write-Host "Powershell update Modul erfolgreich installiert..." -ForegroundColor Green
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Lädt Funktionen aus der Ffunctions.ps1
|
# Lädt Funktionen aus der functions.ps1
|
||||||
Get-ChildItem ~/.winconfig/functions.ps1 | %{. $_ } | out-null
|
Get-ChildItem ~/.winconfig/functions.ps1 | %{. $_ } | out-null
|
||||||
Get-ChildItem ~/.winconfig/aliases.ps1 | %{. $_ } | out-null
|
Get-ChildItem ~/.winconfig/aliases.ps1 | %{. $_ } | out-null
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user