Prettify
This commit is contained in:
Родитель
f14c98418f
Коммит
0346a0b0b2
|
@ -1979,11 +1979,15 @@ if (-not `$restartingInstance) {
|
|||
}
|
||||
|
||||
Write-Host
|
||||
Write-Host -ForegroundColor Yellow "Troubleshooting information, use:"
|
||||
Write-Host "Get-BcContainerEventLog to retrieve a snapshot of the event log from the container"
|
||||
Write-Host "Get-BcContainerDebugInfo to get information about the container"
|
||||
Write-Host "Enter-BcContainer to open a PowerShell prompt inside the container"
|
||||
Write-Host "Remove-BcContainer to remove the container again"
|
||||
Write-Host "Use:"
|
||||
Write-Host -ForegroundColor Yellow -NoNewline "Get-BcContainerEventLog"
|
||||
Write-Host " to retrieve a snapshot of the event log from the container"
|
||||
Write-Host -ForegroundColor Yellow -NoNewline "Get-BcContainerDebugInfo"
|
||||
Write-Host " to get information about the container"
|
||||
Write-Host -ForegroundColor Yellow -NoNewline "Enter-BcContainer"
|
||||
Write-Host " to open a PowerShell prompt inside the container"
|
||||
Write-Host -ForegroundColor Yellow -NoNewline "Remove-BcContainer"
|
||||
Write-Host " to remove the container again"
|
||||
}
|
||||
Set-Alias -Name New-NavContainer -Value New-BcContainer
|
||||
Export-ModuleMember -Function New-BcContainer -Alias New-NavContainer
|
||||
|
|
|
@ -38,9 +38,14 @@ function Add-FontsToBcContainer {
|
|||
|
||||
$found = $false
|
||||
Get-ChildItem $path -ErrorAction Ignore | % {
|
||||
if (!$ExistingFonts.Contains($_.Name) -and $extensions.Contains($_.Extension.ToLowerInvariant())) {
|
||||
Copy-Item -Path $_.FullName -Destination $fontsFolder
|
||||
$found = $true
|
||||
if ($extensions.Contains($_.Extension.ToLowerInvariant())) {
|
||||
if ($ExistingFonts.Contains($_.Name)) {
|
||||
Write-Host "Skipping font '$($_.Name)' as it is already installed"
|
||||
}
|
||||
else {
|
||||
Copy-Item -Path $_.FullName -Destination $fontsFolder
|
||||
$found = $true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ function Import-TestToolkitToBcContainer {
|
|||
} -argumentList $appFile
|
||||
|
||||
if ($isInstalled) {
|
||||
Write-Host "Skipping $appFile as it is already installed"
|
||||
Write-Host "Skipping app '$appFile' as it is already installed"
|
||||
}
|
||||
else {
|
||||
Publish-BcContainerApp -containerName $containerName -appFile ":$appFile" -skipVerification -sync -install -scope $scope -useDevEndpoint:$useDevEndpoint -replaceDependencies $replaceDependencies -credential $credential
|
||||
|
|
50
addfonts.ps1
50
addfonts.ps1
|
@ -44,30 +44,34 @@ $hashFontFileTypes.Add(".otf", " (OpenType)")
|
|||
$fontRegistryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
|
||||
|
||||
Get-ChildItem $PSScriptRoot -ErrorAction Ignore | % {
|
||||
if (!$ExistingFonts.Contains($_.Name) -and $_.Extension -ne ".ini" -and $_.Extension -ne ".ps1") {
|
||||
|
||||
if ($_.Extension -ne ".ini" -and $_.Extension -ne ".ps1") {
|
||||
$path = Join-Path "c:\Windows\Fonts" $_.Name
|
||||
Copy-Item -Path $_.FullName -Destination $path
|
||||
|
||||
$fileDir = split-path $path
|
||||
$fileName = split-path $path -leaf
|
||||
$fileExt = (Get-Item $path).extension
|
||||
$fileBaseName = $fileName -replace($fileExt ,"")
|
||||
|
||||
$shell = new-object -com shell.application
|
||||
$myFolder = $shell.Namespace($fileDir)
|
||||
$fileobj = $myFolder.Items().Item($fileName)
|
||||
$fontName = $myFolder.GetDetailsOf($fileobj,21)
|
||||
|
||||
if ($fontName -eq "") { $fontName = $fileBaseName }
|
||||
|
||||
$retVal = [FontResource.AddRemoveFonts]::AddFont($path)
|
||||
|
||||
if ($retVal -eq 0) {
|
||||
Write-Host -ForegroundColor Red "Font `'$($path)`'`' installation failed"
|
||||
} else {
|
||||
Write-Host -ForegroundColor Green "Font `'$($path)`' installed successfully"
|
||||
Set-ItemProperty -path "$($fontRegistryPath)" -name "$($fontName)$($hashFontFileTypes.item($fileExt))" -value "$($fileName)" -type STRING
|
||||
if ($ExistingFonts.Contains($_.Name)) {
|
||||
Write-Host "Skipping font '$path' as it is already installed"
|
||||
}
|
||||
else {
|
||||
Copy-Item -Path $_.FullName -Destination $path
|
||||
|
||||
$fileDir = split-path $path
|
||||
$fileName = split-path $path -leaf
|
||||
$fileExt = (Get-Item $path).extension
|
||||
$fileBaseName = $fileName -replace($fileExt ,"")
|
||||
|
||||
$shell = new-object -com shell.application
|
||||
$myFolder = $shell.Namespace($fileDir)
|
||||
$fileobj = $myFolder.Items().Item($fileName)
|
||||
$fontName = $myFolder.GetDetailsOf($fileobj,21)
|
||||
|
||||
if ($fontName -eq "") { $fontName = $fileBaseName }
|
||||
|
||||
$retVal = [FontResource.AddRemoveFonts]::AddFont($path)
|
||||
|
||||
if ($retVal -eq 0) {
|
||||
Write-Host -ForegroundColor Red "Font '$path' installation failed"
|
||||
} else {
|
||||
Set-ItemProperty -path "$($fontRegistryPath)" -name "$($fontName)$($hashFontFileTypes.item($fileExt))" -value "$($fileName)" -type STRING
|
||||
Write-Host -ForegroundColor Green "Font '$path' installed successfully"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче