Is "sample" a file or a folder?
The example from the cmdlets' help shows the need for a trailing "\" if a local folder is used as the -Path parameter value.
For example:
- C:\Folder\
- C:\Folder\Filename
- \Server\Folder
- http://sharepoint.contoso.com/Shared%20Documents/Folder
If that doesn't help, try adding the "-Verbose" switch to the cmdlet. Keep in mind that verbose output is sent to a separate stream. If you don't run the command interactively, you'll have to redirect the verbose stream to some other stream. See here for examples: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_redirection?view=powershell-5.1
Edit: I didn't notice that the text editor will remove a single "\" character in some cases unless it't typed as TWO backslash characters.