Issue

When trying to change a property of type Date of a Vault File using the Update-VaultFile Commandlet, it clears the property or doesn’t correctly


Solution

To avoid this problem, define a DateTime object and write your new date as parameter.

Example

To change a date property of the file to the 5th of august 2018 and update the Vault file (change <DateTypePropertyName> to the name of the property you want to change):


$day = 5
$month = 8
$year = 2018

$date = [System.DateTime]::new($year, $month, $day)
Update-VaultFile -File $file._FullPath -Properties @{<DateTypePropertyName> = $date}


See Also