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

Disable cmdlets that are not supported under unix system#5083

Merged
adityapatwardhan merged 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
chunqingchen:bugfix1chunqingchen/PowerShell:bugfix1Copy head branch name to clipboard
Nov 10, 2017
Merged

Disable cmdlets that are not supported under unix system#5083
adityapatwardhan merged 3 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
chunqingchen:bugfix1chunqingchen/PowerShell:bugfix1Copy head branch name to clipboard

Conversation

@chunqingchen

@chunqingchen chunqingchen commented Oct 11, 2017

Copy link
Copy Markdown
Contributor

resolve #4355

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

@iSazonov

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

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

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

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@adityapatwardhan updated

public void LoadCommandStop(string Name) { WriteEvent(26, Name); }
}
}
} No newline at end of file

Copy link
Copy Markdown
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
Copy Markdown
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
}
}
} No newline at end of file

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

@iSazonov your comment is resolved

@iSazonov iSazonov left a comment

Copy link
Copy Markdown
Collaborator

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
}
}
} No newline at end of file

Copy link
Copy Markdown
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); }
}
}
} No newline at end of file

Copy link
Copy Markdown
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.

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.

missing newline

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.

missing newline

@TravisEz13 TravisEz13 left a comment

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.

Fix minor issue and it should be good

@chunqingchen

Copy link
Copy Markdown
Contributor Author

@TravisEz13 new line added.

@iSazonov iSazonov left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

@adityapatwardhan @iSazonov your comments are resolved. Thanks

@iSazonov

iSazonov commented Nov 8, 2017

Copy link
Copy Markdown
Collaborator

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

@adityapatwardhan

Copy link
Copy Markdown
Member

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

@iSazonov

Copy link
Copy Markdown
Collaborator

CI Travis was passed but not reported.

@adityapatwardhan

Copy link
Copy Markdown
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

vinodc commented Feb 21, 2018

Copy link
Copy Markdown

@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
Copy Markdown
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

vinodc commented Feb 22, 2018

Copy link
Copy Markdown

@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

dreyTee commented May 5, 2019

Copy link
Copy Markdown

@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

iSazonov commented May 5, 2019

Copy link
Copy Markdown
Collaborator

@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

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