Run New-Item with -Force as items can pre-exist on self-hosted environments

Pipe output to $null as that is removed for verbose and not Out-Null, and is also faster
This commit is contained in:
Shivam Mathur
2021-08-25 09:46:36 +05:30
parent ed62711289
commit f6b4601c63
2 changed files with 8 additions and 8 deletions

View File

@ -31,7 +31,7 @@ Function Repair-ICU() {
}
$zip_url = Get-ICUUrl $icu.Groups[1].Value $installed.Architecture $vs
if ($zip_url -ne '') {
New-Item -Path "$php_dir" -Name "icu" -ItemType "directory" | Out-Null
New-Item -Path "$php_dir" -Name "icu" -ItemType "directory" -Force > $null 2>&1
Invoke-WebRequest -Uri $zip_url -OutFile "$php_dir\icu\icu.zip"
Expand-Archive -Path $php_dir\icu\icu.zip -DestinationPath $php_dir\icu -Force
Get-ChildItem $php_dir\icu\bin -Filter *.dll | Copy-Item -Destination $php_dir -Force