FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add `Unblock-File` for macOS by TravisEz13 · Pull Request #11137 · PowerShell/PowerShell · GitHub

Add Unblock-File for macOS - #11137

Merged
Travis Plunk (TravisEz13) merged 13 commits into
PowerShell:masterfrom
TravisEz13:unblock
Dec 3, 2019
Merged

Add Unblock-File for macOS#11137
Travis Plunk (TravisEz13) merged 13 commits into
PowerShell:masterfrom
TravisEz13:unblock

Conversation

Travis Plunk (TravisEz13) commented Nov 20, 2019
edited
Loading

Copy link
Copy Markdown
Member

PR Summary

Add Unblock-File for macOS

PR Context

Adds a viable workaround for #10874, not just for our package but for other packages.

PR Checklist

ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Nov 21, 2019
Co-Authored-By: Steve Lee <slee@microsoft.com>
Co-Authored-By: Ilya <darpa@yandex.ru>
Travis Plunk (TravisEz13) marked this pull request as ready for review November 22, 2019 21:49
Travis Plunk (TravisEz13) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Nov 22, 2019
{
string errorMessage = UnblockFileStrings.LinuxNotSupported;
Exception e = new NotImplementedException(errorMessage);
ThrowTerminatingError(new ErrorRecord(e, "LinuxNotSupported", ErrorCategory.NotImplemented, null));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Please use named parameters.

{
if(IsBlocked(path))
{
UInt32 result = RemoveXattr(path,MacBlockAttribute,RemovexattrFollowSymLink);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit: spaces after ,

{
string errorMessage = string.Format(CultureInfo.CurrentUICulture, UnblockFileStrings.UnblockError, path);
Exception e = new InvalidOperationException(errorMessage);
WriteError(new ErrorRecord(e, "UnblockError", ErrorCategory.InvalidResult,path));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

nit: spaces after ,

if(result != 0)
{
string errorMessage = string.Format(CultureInfo.CurrentUICulture, UnblockFileStrings.UnblockError, path);
Exception e = new InvalidOperationException(errorMessage);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

maybe this should be System.PlatformNotSupportedException

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

definitely not, we are on a supported platform here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

maybe you meant line 142... changed it there.

ghost added Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept and removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept labels Dec 2, 2019

Copy link
Copy Markdown

🎉v7.0.0-rc.1 has been released which incorporates this pull request.:tada:

Handy links:

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL