cmd “Set-NcCifsOption -VserverContext $VserverName -IsCopyOffloadEnabled:$false -IsCopyOffloadDirectCopyEnabled:$false” which is used in WFA to disable CopyOffload function, does not seem to work. manually it does, but not in the script.
This optional parameter enables the Copy Offload feature in the CIFS server. If set to false, the Copy Offload feature is disabled. The default for this parameter is true. Copy Offload has no effect on files in a FlexGroup because FlexGroups do not support Copy Offload.
I think PSTK might be trying to point to an option like -is-copy-offload-enabled, which does not exist in ONTAP:
::*> cifs options show -vserver DEMO -fields is-copy-offload-enabled
Error: invalid argument "is-copy-offload-enabled"
And when you run the command with an option that works, it doesn’t error out (as in your case) - it just doesn't work.
Warning: When Copy Offload was disabled for Vserver "DEMO", the Direct-Copy mechanism was also disabled. If you re-enable Copy Offload and want to enable Direct-Copy, specify "-is-copy-offload-direct-copy-enabled true" with "-copy-offload-enabled true".