Silence unnecessary console output

This commit is contained in:
Manuel Thalmann 2023-07-19 23:19:05 +02:00
parent 6ae6755957
commit 62224f1ab0
6 changed files with 7 additions and 7 deletions

View file

@ -12,7 +12,7 @@ foreach ($profileFile in $files) {
$dirName = Split-Path -Parent $fullName;
if (-not (Test-Path -PathType Container $dirName)) {
New-Item -Force -ItemType Directory $dirName;
$null = New-Item -Force -ItemType Directory $dirName;
}
Copy-Item -Force "~/$profileFile" $fullName;

View file

@ -10,7 +10,7 @@ function Invoke-WindowsInstallation([Context] $context)
if (-not $context.Get("InitialConfiguration")) {
$configPath = "$PSScriptRoot/../Config";
Enable-WindowsOptionalFeature -Online -All -FeatureName "NetFx3";
$null = Enable-WindowsOptionalFeature -Online -All -FeatureName "NetFx3";
. "$configPath/Windows/Install.ps1" $context;
. "$configPath/Explorer/Install.ps1" $context;
@ -32,7 +32,7 @@ function Invoke-WindowsInstallation([Context] $context)
Install-Firefox $context;
choco install -y selenium-gecko-driver;
Install-Package -Force Selenium.WebDriver -SkipDependencies;
$null = Install-Package -Force Selenium.WebDriver -SkipDependencies;
winget install --accept-source-agreements --accept-package-agreements -e --id AutoHotkey.AutoHotkey;

View file

@ -10,7 +10,7 @@ if (-not ("OpenQA.Selenium.Firefox.FirefoxDriver" -as [type])) {
[byte[]]$bytes = $stream.ToArray();
$reader.Close();
$zipFile.Dispose();
[System.Reflection.Assembly]::Load($bytes);
$null = [System.Reflection.Assembly]::Load($bytes);
}
}

View file

@ -6,7 +6,7 @@ $null = powershell -c Get-PackageProvider -ListAvailable NuGet;
if (-not $?) {
Write-Host "Installing NuGet PackageProvider";
powershell -c Install-PackageProvider -Name NuGet -Force;
powershell -c $null = Install-PackageProvider -Name NuGet -Force;
}
foreach ($module in @("PSWindowsUpdate", "KnownFolders"))

View file

@ -17,7 +17,7 @@ $null = New-Module {
foreach ($feature in $features) {
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Information "Enabling the ``$feature`` feature";
Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
$null = Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
}
}

View file

@ -18,7 +18,7 @@ $null = New-Module {
foreach ($feature in $features) {
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
Write-Information "Enabling the ``$feature`` feature";
Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
$null = Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
}
}