Repository navigation
Closed
Labels
HacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issues
Description
Steps to reproduce
C:\PS> Get-Date > Date.tmp
C:\PS> New-FileCatalog -CatalogVersion 2 -CatalogFilePath catalog.cat -Path Date.tmp -WhatIfExpected behavior
What if: Performing the operation "Create new file catalog" on target "C:\PS\catalog.cat".Actual behavior
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 12/9/2016 12:37 PM 433 catalog.catYou can see the file has been created.
The Hash is also being calculated too.
C:\PS> Test-FileCatalog -Detailed -CatalogFilePath catalog.cat
Status : Valid
HashAlgorithm : SHA256
CatalogItems : {[Date.tmp, 2F38E0FD77AF90E6E463938C4D4ED9AE03F575AC7C0441C6A3DBE9A1C4D55459]}
PathItems : {[Date.tmp, 2F38E0FD77AF90E6E463938C4D4ED9AE03F575AC7C0441C6A3DBE9A1C4D55459]}
Signature : System.Management.Automation.Signature
C:\PS> Get-FileHash -Path Date.tmp
Algorithm : SHA256
Hash : 2F38E0FD77AF90E6E463938C4D4ED9AE03F575AC7C0441C6A3DBE9A1C4D55459
Path : C:\Temp\Demo\Date.tmp
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.14393.206
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.14393.206
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Metadata
Metadata
Assignees
Labels
HacktoberfestPotential candidate to participate in HacktoberfestIssue-Enhancementthe issue is more of a feature request than a bugResolution-FixedThe issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issues
Activity
iSazonov commentedon Dec 9, 2016
PatrickFB Could you make the test with the latest build Powershell 6.0?
kittholland commentedon Dec 9, 2016
I was able to reproduce based on his steps.
MarekZietek commentedon Feb 24, 2019
PowerShell/src/Microsoft.PowerShell.Security/security/CatalogCommands.cs
Lines 117 to 120 in 5d54f1a
There already exists a call to ShouldProcess in CatalogCommands.cs. Apparently the reason that it doesn't work is that it calls the 1-parameter function and not the 2-parameter one. This is weird because both methods should do the same thing but they don't. Adding a second parameter action fixes it.
Is this expected behavior for the single parameter method to return true when what if is specified?
iSazonov commentedon Feb 25, 2019
No repo is in 6.2 version.