Skip to content

馃[Bug]: -Force option not working#109

Description

Describe the bug

When installing fonts, with -Force option, I still see exceptions for already existing fonts. I use force to upgrade existing ones, but I can't do it.

Here's the command with the output:

PS C:\Users\alex> Install-NerdFont -All -Force -Scope AllUsers

Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFont-Bold.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFont-Italic.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFont-Regular.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFontMono-Bold.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFontMono-Italic.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFontMono-Regular.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFontPropo-Bold.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFontPropo-Italic.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\0xProtoNerdFontPropo-Regular.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFont-Condensed.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFont-Regular.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFont-SemiCondensed.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFontMono-Condensed.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFontMono-Regular.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFontMono-SemiCondensed.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFontPropo-Condensed.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFontPropo-Regular.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\3270NerdFontPropo-SemiCondensed.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\AgaveNerdFont-Bold.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\AgaveNerdFont-Regular.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\AgaveNerdFontMono-Bold.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\AgaveNerdFontMono-Regular.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\AgaveNerdFontPropo-Bold.ttf' already exists."
Install-Font: Failed [10/10] - Stopping
Install-Font: Exception calling "CopyTo" with "1" argument(s): "The file 'C:\WINDOWS\Fonts\AgaveNerdFontPropo-Regular.ttf' already exists."

Version information

Name                           Value
----                           -----
PSVersion                      7.6.5
PSEdition                      Core
GitCommitId                    7.6.5
OS                             Microsoft Windows 10.0.26120
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0鈥
PSRemotingProtocolVersion      2.4
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     1.1.1                 NerdFonts                           Core,Desk {Get-NerdFont, Install-NerdFont, Get-NerdFonts, Install-NerdFonts}

To reproduce

Install-NerdFont -All -Force -Scope AllUsers

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions