Remove-FileLabel cmdlet is getting stuck sometimes

Sundram Sontirkey 132 Reputation points
2024-06-27T06:47:00.7266667+00:00

Hi,

I have been exploring the new Microsoft Purview Infromation Protection PowerShell Module. I have been testing Remove-FileLabel cmdlet.

Remove-FileLabel -Path "C:\Users\user\Documents\sample" -JustificationMessage "Migration Requirement"

It's getting stuck sometime after when there is large file share around 10 K or more.

I want to understand why this error comes. Is there any limitation of this cmdlet.

Thanks!

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Microsoft Purview
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 48,026 Reputation points
    2024-06-27T15:31:51.4433333+00:00

    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:

    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.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.