8000 Add `Unblock-File` for macOS by TravisEz13 · Pull Request #11137 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@TravisEz13
Copy link
Member
@TravisEz13 TravisEz13 commented Nov 20, 2019

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 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
TravisEz13 and others added 4 commits November 21, 2019 11:36
Co-Authored-By: Steve Lee <slee@microsoft.com>
Co-Authored-By: Ilya <darpa@yandex.ru>
@TravisEz13 TravisEz13 marked this pull request as ready for review November 22, 2019 21:49
@TravisEz13 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
@TravisEz13 TravisEz13 added this to the rc.1-consider milestone Nov 22, 2019
{
string errorMessage = UnblockFileStrings.LinuxNotSupported;
Exception e = new NotImplementedException(errorMessage);
ThrowTerminatingError(new ErrorRecord(e, "LinuxNotSupported", ErrorCategory.NotImplemented, null));
Copy link
Member

Choose a reason for hiding this comment

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

Please use named parameters.

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

Choose a reason for hiding this comment

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

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
Member

Choose a reason for hiding this comment

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

nit: spaces after ,

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

Choose a reason for hiding this comment

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

maybe this should be System.PlatformNotSupportedException

Copy link
Member Author

Choose a reason for hiding this comment

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

definitely not, we are on a supported platform here.

Copy link
Member Author

Choose a reason for hiding this comment

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

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

@ghost 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
@TravisEz13 TravisEz13 merged commit 3cdab0d into PowerShell:master Dec 3, 2019
@TravisEz13 TravisEz13 deleted the unblock branch December 3, 2019 01:51
TravisEz13 added a commit that referenced this pull request Dec 4, 2019
@TravisEz13 TravisEz13 modified the milestones: rc.1-approved, 7.0.0-rc.1 Dec 4, 2019
@ghost
Copy link
ghost commented Dec 16, 2019

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

Handy links:

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

0