8000 Disable cmdlets that are not supported under unix system by chunqingchen · Pull Request #5083 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@chunqingchen
Copy link
Contributor
@chunqingchen chunqingchen commented Oct 11, 2017

resolve #4355

Removed cmdlets from IntialSessionState.cs so they will not be available on unix platforms.

@iSazonov
Copy link
Collaborator

Usually we exclude not ported cmdlets with #if !UNIX (or exclude whole file in csproj) and remove from psd1

Also we need correct tests in DefaultCommands.Tests.ps1

@chunqingchen
Copy link
Contributor Author

@iSazonov in issue #4355 you mentioned not implantation exception should be added instead of excluding the cmdlets. Is that not the case now?

@iSazonov
Copy link
Collaborator

@chunqingchen Sorry, my comment was not approved. I remember @daxian-dbw said that it is better exclude code in csproj - it is easy to track. @daxian-dbw Could you confirm?

Copy link
Member

Choose a reason for hiding this comment

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

Extra line added.

Copy link
Member

Choose a reason for hiding this comment

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

Would ! Platform.IsWindows work?

Copy link
Member

Choose a reason for hiding this comment

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

For consistency sake, can we use non-windows path here?

Copy link
Member

Choose a reason for hiding this comment

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

For consistency sake, can we use non-windows path here?

@chunqingchen
Copy link
Contributor Author

@adityapatwardhan your comments are resolved.

@chunqingchen chunqingchen force-pushed the bugfix1 branch 2 times, most recently from c8d72b3 to 063b5d1 Compare October 28, 2017 02:16
@TravisEz13
Copy link
Member

The last commit is lot linked to a github account. Please resolve.

8000

@chunqingchen chunqingchen force-pushed the bugfix1 branch 3 times, most recently from d8d84b3 to d70bbac Compare October 31, 2017 22:28
@adityapatwardhan
Copy link
Member

@chunqingchen The title and the description needs to be updated to match the implementation.

@chunqingchen chunqingchen force-pushed the bugfix1 branch 4 times, most recently from 4781090 to 88fd625 Compare November 1, 2017 05:58
@chunqingchen chunqingchen changed the title add notimplementedException to cmdlets that are temporary not support… Disable cmdlets that are not supported under unix system Nov 1, 2017
@chunqingchen
Copy link
Contributor Author

@adityapatwardhan updated

public void LoadCommandStop(string Name) { WriteEvent(26, Name); }
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add new line at EOF.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@chunqingchen Sorry, we should add newline after the last brace not before.

Test-Path Function:more | Should Be $true
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add new line at EOF.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@chunqingchen Sorry, we should add newline after the last brace not before.

@chunqingchen
Copy link
Contributor Author

@iSazonov your comment is resolved

Copy link
Collaborator
@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

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

Leave a comment

Test-Path Function:more | Should Be $true
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@chunqingchen Sorry, we should add newline after the last brace not before.

public void LoadCommandStop(string Name) { WriteEvent(26, Name); }
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

@chunqingchen Sorry, we should add newline after the last brace not before.

DEC0
Copy link
Member

Choose a reason for hiding this comment

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

missing newline

Copy link
Member

Choose a reason for hiding this comment

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

missing newline

Copy link
Member
@TravisEz13 TravisEz13 left a comment

Choose a reason for hiding this comment

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

Fix minor issue and it should be good

@chunqingchen
Copy link
Contributor Author

@TravisEz13 new line added.

Copy link
Collaborator
@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

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

Should we exclude the code from compilation?

public void LoadCommandStart(string Name) { WriteEvent(25, Name); }
public void LoadCommandStop(string Name) { WriteEvent(26, Name); }
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please revert the formatting change and remove the line.

It "Should have 'more' as a function" {
Test-Path Function:more | Should Be $true
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please revert the formatting change and remove the line.

@adityapatwardhan
Copy link
Member

@chunqingchen Please run all tests using [Feature] in your git commit message.

https://github.com/PowerShell/PowerShell/blob/a1b7f8be3ea4ac7e4f7a67e6261ad68cdb23143d/docs/testing-guidelines/testing-guidelines.md#requesting-additional-tests-for-a-pr

@chunqingchen
Copy link
Contributor Author

@adityapatwardhan @iSazonov your comments are resolved. Thanks

@iSazonov
Copy link
Collaborator
iSazonov commented Nov 8, 2017

I believe the PR need #5379 to pass CI Appveyor.

@adityapatwardhan
Copy link
Member

@chunqingchen Can you have a look at the Travis CI failure?

@iSazonov
Copy link
Collaborator

CI Travis was passed but not reported.

@adityapatwardhan
Copy link
Member

Merging as CI has passed but webhook did not update status to GitHub.

@adityapatwardhan adityapatwardhan merged commit 2be13a6 into PowerShell:master Nov 10, 2017
@vinodc
Copy link
vinodc commented Feb 21, 2018

@paulcallen Would you happen to know if New-PSSessionOption has been disabled? We updated to the latest version from 6.0.0 beta1 and this no longer works. It was previously working great and we have been using it with New-PSSessionOption since PowerShell/psl-omi-provider#67 was merged in.

@dantraMSFT
Copy link
Contributor

@vinodc I'll dig into this. For now, you can use [System.Management.Automation.Remoting.PSSessionOption]::new() and populate the returned object.

BTW: What's the use case you have for it on Linux. Perhaps it was missed with the cmdlet was removed.

@vinodc
Copy link
vinodc commented Feb 22, 2018

@dantraMSFT Thanks for the quick response. We are programmatically accessing Office 365 PowerShell cmdlets and in the process our code creates PSSessionOption objects. We can work around this temporarily, but wanted to make sure that the overall implementation itself is still supported for related commands used to connect to Office 365 PowerShell, starting with New-PSSessionOption.

On a broader note, this is related to piped commands failing (#6206), where we were recommended to update PowerShell first to see if we could reproduce the failure on the latest version, which resulted in these new issues coming up.

@dreyTee
Copy link
dreyTee commented May 5, 2019

@paulcallen Would you happen to know if New-PSSessionOption has been disabled?

Have same issue when trying to use WINRM from linux without proper server certificate:
Getting error:
Use the PSSessionOption -SkipCACheck and -SkipCNCheck
Trying to use thes options with New-PSSessionOption but can't:
New-PSSessionOption : The term 'New-PSSessionOption' is not recognized as the name of a cmdlet, function, script file, or operable program.
Please advise a workaround a least.

@iSazonov
Copy link
Collaborator
iSazonov commented May 5, 2019

@dreyTee Please open new issue for your question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Determine *-PSSession and *-PSSessionConfiguration Cmdlet Support Via OMI

7 participants

0