Skip to content

New-FileCatalog creates 0-byte .CAT file, breaks cmd replay #3068

@ghost

Description

Using -Whatif with new-filecatalog creates a 0-byte .CAT file.

Expected Behavior
Using -Whatif should have no impact on the system, so that removing -Whatif and replaying the command will succeed.

Current Behavior
Current behavior prevents replaying the command without -Whatif because the 0-byte .Cat file is present.
That file cannot be over-written without adding -Force, so replaying the command fails.
Possible Solution
No .Cat file should be created if -Whatif is specified.

Your Environment
$PSVersionTable

Name Value

PSVersion 5.1.14393.693
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.693
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Get-Command new-filecatalog
Cmdlet: New-FileCatalog 3.0.0.0
Microsoft.PowerShell.Security

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions