Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Unblock-File should not throw error if file is not blocked #5353

Copy link
Copy link
@SteveL-MSFT

Description

@SteveL-MSFT
Issue body actions

When unblock-file can't find the alternate stream for a blocked file, it reports a technically correct, but useless error message. For files that aren't even blocked (downloaded from untrusted internet zone), we should just quietly ignore the error and return success.

Steps to reproduce

unblock-file $profile

Expected behavior

no error

Actual behavior

unblock-file : The system cannot find the file specified
At line:1 char:1
+ unblock-file $profile
+ ~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : PermissionDenied: (C:\Users\slee\D...ell_profile.ps1:String) [Unblock-File], Win32Exception
+ FullyQualifiedErrorId : RemoveItemUnauthorizedAccessError,Microsoft.PowerShell.Commands.UnblockFileCommand

Environment data

Name                           Value
----                           -----
PSVersion                      6.0.0-beta.9
PSEdition                      Core
GitCommitId                    v6.0.0-beta.9
OS                             Microsoft Windows 10.0.17035
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Resolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.