Powershell .NET Set permissions and Preserve times options
How can i set the following options as per the .NET assembly instructions in powershell?
When using .NET assembly, set TransferOptions as follows:
when i attempt to use "null" or "false" in powershell i get the following errors:
i was able to get the script to run using:
not sure if this is the correct way of doing the above. any help is greatly appreciated.
When using .NET assembly, set TransferOptions as follows:
TransferOptions transferOptions = new TransferOptions(); ... transferOptions.FilePermissions = null; // This is default transferOptions.PreserveTimestamp = false;
when i attempt to use "null" or "false" in powershell i get the following errors:
The term 'null' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. The term 'false' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
i was able to get the script to run using:
$transferOptions.FilePermissions = Out-Null $transferOptions.PreserveTimestamp = Out-Null
not sure if this is the correct way of doing the above. any help is greatly appreciated.