From c22dd049672353f1a17187328a48ccb41b24bcd3 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 14:45:14 -0700 Subject: [PATCH 1/8] Move Utility module declaration to Windows-Core modules Since we need different versions for Windows and Unix. --- .../Microsoft.PowerShell.Utility.psd1 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Modules/{Windows+Unix-Core => Windows-Core}/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 (100%) diff --git a/src/Modules/Windows+Unix-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Windows-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 similarity index 100% rename from src/Modules/Windows+Unix-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 rename to src/Modules/Windows-Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 From 9c07b9f29de0d815046becf05adcd21a8f0e3278 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 14:46:59 -0700 Subject: [PATCH 2/8] Add copy of Utility module declaration for Unix Unmodified so we can track changes. --- .../Microsoft.PowerShell.Utility.psd1 | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 diff --git a/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 new file mode 100644 index 000000000..acefbaa1d --- /dev/null +++ b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -0,0 +1,31 @@ +@{ +GUID="1DA87E53-152B-403E-98DC-74D7B4D63D59" +Author="Microsoft Corporation" +CompanyName="Microsoft Corporation" +Copyright="© Microsoft Corporation. All rights reserved." +ModuleVersion="3.1.0.0" +PowerShellVersion="3.0" +CmdletsToExport= "Format-List", "Format-Custom", "Format-Table", "Format-Wide", + "Out-File", "Out-String", "Get-FormatData", "Export-FormatData", "ConvertFrom-Json", "ConvertTo-Json", + "Invoke-RestMethod", "Invoke-WebRequest", "Register-ObjectEvent", "Register-EngineEvent", + "Wait-Event", "Get-Event", "Remove-Event", "Get-EventSubscriber", "Unregister-Event", + "New-Event", "Add-Member", "Add-Type", "Compare-Object", "ConvertFrom-StringData", + "Export-Csv", "Import-Csv", "ConvertTo-Csv", "ConvertFrom-Csv", "Export-Alias", "Invoke-Expression", + "Get-Alias", "Get-Culture", "Get-Date", "Get-Host", "Get-Member", "Get-Random", + "Get-UICulture", "Get-Unique", "Import-Alias", "Import-LocalizedData", + "Select-String", "Measure-Object", "New-Alias", "New-TimeSpan", "Read-Host", "Set-Alias", "Set-Date", + "Start-Sleep", "Tee-Object", "Measure-Command", "Update-TypeData", "Update-FormatData", + "Remove-TypeData", "Get-TypeData", "Write-Host", "Write-Progress", "New-Object", "Select-Object", + "Group-Object", "Sort-Object", "Get-Variable", "New-Variable", "Set-Variable", "Remove-Variable", + "Clear-Variable", "Export-Clixml", "Import-Clixml", "ConvertTo-Xml", "Select-Xml", "Write-Debug", + "Write-Verbose", "Write-Warning", "Write-Error", "Write-Information", "Write-Output", "Set-PSBreakpoint", + "Get-PSBreakpoint", "Remove-PSBreakpoint", "Enable-PSBreakpoint", "Disable-PSBreakpoint", "Get-PSCallStack", + "Get-TraceSource", "Set-TraceSource", "Trace-Command", + "Unblock-File", "Get-Runspace", "Debug-Runspace", "Enable-RunspaceDebug", "Disable-RunspaceDebug", + "Get-RunspaceDebug", "Wait-Debugger" +FunctionsToExport= "Get-FileHash", "New-TemporaryFile", "New-Guid", "Format-Hex", "Import-PowerShellDataFile", + "ConvertFrom-SddlString" +AliasesToExport= "fhx" +NestedModules="Microsoft.PowerShell.Commands.Utility.dll","Microsoft.PowerShell.Utility.psm1" +HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390787' +} From 280bd651c17e167fc36157c706325ca12f1f4123 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 15:08:53 -0700 Subject: [PATCH 3/8] Remove unimplemented Utility cmdlets from Unix ConvertFrom-SddlString and Unblock-File are Windows-specific cmdlets with no equivalent on Unix. squash! Remove Unblock-File from Unix --- .../Microsoft.PowerShell.Utility.psd1 | 5 ++--- .../Unimplemented-Cmdlet.Tests.ps1 | 13 +++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 diff --git a/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 index acefbaa1d..45fa2f9c3 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -21,10 +21,9 @@ CmdletsToExport= "Format-List", "Format-Custom", "Format-Table", "Format-Wide", "Write-Verbose", "Write-Warning", "Write-Error", "Write-Information", "Write-Output", "Set-PSBreakpoint", "Get-PSBreakpoint", "Remove-PSBreakpoint", "Enable-PSBreakpoint", "Disable-PSBreakpoint", "Get-PSCallStack", "Get-TraceSource", "Set-TraceSource", "Trace-Command", - "Unblock-File", "Get-Runspace", "Debug-Runspace", "Enable-RunspaceDebug", "Disable-RunspaceDebug", + "Get-Runspace", "Debug-Runspace", "Enable-RunspaceDebug", "Disable-RunspaceDebug", "Get-RunspaceDebug", "Wait-Debugger" -FunctionsToExport= "Get-FileHash", "New-TemporaryFile", "New-Guid", "Format-Hex", "Import-PowerShellDataFile", - "ConvertFrom-SddlString" +FunctionsToExport= "Get-FileHash", "New-TemporaryFile", "New-Guid", "Format-Hex", "Import-PowerShellDataFile" AliasesToExport= "fhx" NestedModules="Microsoft.PowerShell.Commands.Utility.dll","Microsoft.PowerShell.Utility.psm1" HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390787' diff --git a/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 new file mode 100644 index 000000000..f53f4177c --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Utility/Unimplemented-Cmdlet.Tests.ps1 @@ -0,0 +1,13 @@ +Describe "Unimplemented Utility Cmdlet Tests" -Tags "CI" { + + $Commands = @( + "Unblock-File", + "ConvertFrom-SddlString" + ) + + foreach ($Command in $Commands) { + It "$Command should only be available on Windows" { + [bool](Get-Command $Command -ErrorAction SilentlyContinue) | Should Be $IsWindows + } + } +} From e750fb6284979370a844e7b1d8ab052e7f167f0d Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 14:45:14 -0700 Subject: [PATCH 4/8] Move Management module declaration to Windows-Core modules Since we need different versions for Windows and Unix. --- .../Microsoft.PowerShell.Management.psd1 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/Modules/{Windows+Unix-Core => Windows-Core}/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 (100%) diff --git a/src/Modules/Windows+Unix-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Windows-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 similarity index 100% rename from src/Modules/Windows+Unix-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 rename to src/Modules/Windows-Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 From f68cb8c3853e39a27cf502914eb941e5525cd88d Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 14:46:59 -0700 Subject: [PATCH 5/8] Add copy of Management module declaration for Unix Unmodified so we can track changes. --- .../Microsoft.PowerShell.Management.psd1 | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 diff --git a/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 new file mode 100644 index 000000000..11aff6584 --- /dev/null +++ b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -0,0 +1,68 @@ +@{ +GUID="EEFCB906-B326-4E99-9F54-8B4BB6EF3C6D" +Author="Microsoft Corporation" +CompanyName="Microsoft Corporation" +Copyright="© Microsoft Corporation. All rights reserved." +ModuleVersion="3.1.0.0" +PowerShellVersion="3.0" +NestedModules="Microsoft.PowerShell.Commands.Management.dll" +HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390785' +AliasesToExport = @("gin", "gtz", "stz") +FunctionsToExport = @() +CmdletsToExport=@("Add-Content", + "Clear-Content", + "Clear-ItemProperty", + "Join-Path", + "Convert-Path", + "Copy-ItemProperty", + "Get-ChildItem", + "Get-Content", + "Get-ItemProperty", + "Get-ItemPropertyValue", + "Move-ItemProperty", + "Get-Location", + "Set-Location", + "Push-Location", + "Pop-Location", + "New-PSDrive", + "Remove-PSDrive", + "Get-PSDrive", + "Get-Item", + "New-Item", + "Set-Item", + "Remove-Item", + "Move-Item", + "Rename-Item", + "Copy-Item", + "Clear-Item", + "Invoke-Item", + "Get-PSProvider", + "New-ItemProperty", + "Split-Path", + "Test-Path", + "Get-Process", + "Stop-Process", + "Wait-Process", + "Debug-Process", + "Start-Process", + "Remove-ItemProperty", + "Rename-ItemProperty", + "Resolve-Path", + "Get-Service", + "Stop-Service", + "Start-Service", + "Suspend-Service", + "Resume-Service", + "Restart-Service", + "Set-Service", + "New-Service", + "Set-Content", + "Set-ItemProperty", + "Test-Connection", + "Restart-Computer", + "Stop-Computer", + "Rename-Computer", + "Get-ComputerInfo", + "Get-TimeZone", + "Set-TimeZone") +} From d59710d31039d0b00a94e1e6d6910d0d1b5aa8d0 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 16:02:12 -0700 Subject: [PATCH 6/8] Remove unimplemented Management cmdlets from Unix These are not currently implemented and so should not show up as available. The *-Computer cmdlets are already not compiled for Unix (and so not available), so let's not declare them in the manifest. The Get-ComputerInfo cmdlet does not work on Unix and so should not be made available. Test-Connection depends on an unavailable WMI provider. Get/Set-TimeZone are not yet ported. --- .../Microsoft.PowerShell.Management.psd1 | 18 +---------- .../Unimplemented-Cmdlet.Tests.ps1 | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 diff --git a/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 index 11aff6584..16b1f5aad 100644 --- a/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 +++ b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -7,7 +7,6 @@ ModuleVersion="3.1.0.0" PowerShellVersion="3.0" NestedModules="Microsoft.PowerShell.Commands.Management.dll" HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390785' -AliasesToExport = @("gin", "gtz", "stz") FunctionsToExport = @() CmdletsToExport=@("Add-Content", "Clear-Content", @@ -48,21 +47,6 @@ CmdletsToExport=@("Add-Content", "Remove-ItemProperty", "Rename-ItemProperty", "Resolve-Path", - "Get-Service", - "Stop-Service", - "Start-Service", - "Suspend-Service", - "Resume-Service", - "Restart-Service", - "Set-Service", - "New-Service", "Set-Content", - "Set-ItemProperty", - "Test-Connection", - "Restart-Computer", - "Stop-Computer", - "Rename-Computer", - "Get-ComputerInfo", - "Get-TimeZone", - "Set-TimeZone") + "Set-ItemProperty") } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 new file mode 100644 index 000000000..be7bbea13 --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Management/Unimplemented-Cmdlet.Tests.ps1 @@ -0,0 +1,30 @@ +Describe "Unimplemented Management Cmdlet Tests" -Tags "CI" { + + $Commands = @( + "Get-Service", + "Stop-Service", + "Start-Service", + "Suspend-Service", + "Resume-Service", + "Restart-Service", + "Set-Service", + "New-Service", + + "Restart-Computer", + "Stop-Computer", + "Rename-Computer", + + "Get-ComputerInfo", + + "Test-Connection", + + "Get-TimeZone", + "Set-TimeZone" + ) + + foreach ($Command in $Commands) { + It "$Command should only be available on Windows" { + [bool](Get-Command $Command -ErrorAction SilentlyContinue) | Should Be $IsWindows + } + } +} From 5310423678a792e3b95638a92958e3dd7ca5419c Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 16:14:17 -0700 Subject: [PATCH 7/8] Remove Windows+Unix-Core There are no longer module declarations that are identical between Core PowerShell on Windows and on Unix. --- src/powershell-unix/project.json | 4 +--- src/powershell-win-core/project.json | 4 +--- src/powershell-win-full/project.json | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/powershell-unix/project.json b/src/powershell-unix/project.json index f2d93ea8e..55511c10e 100644 --- a/src/powershell-unix/project.json +++ b/src/powershell-unix/project.json @@ -12,7 +12,6 @@ "mappings": { "Modules/" : { "include": [ - "../Modules/Windows+Unix-Core", "../Modules/Unix", "../Modules/Shared" ], @@ -36,7 +35,6 @@ "mappings": { "Modules/" : { "include": [ - "../Modules/Windows+Unix-Core", "../Modules/Unix", "../Modules/Shared" ], @@ -49,7 +47,7 @@ "*.so", "*.dylib", "../../powershell.version" - ], + ] }, "dependencies": { diff --git a/src/powershell-win-core/project.json b/src/powershell-win-core/project.json index b8c815db4..91d41b80f 100644 --- a/src/powershell-win-core/project.json +++ b/src/powershell-win-core/project.json @@ -13,7 +13,6 @@ "Modules/" : { "include": [ "../Modules/Windows-Core", - "../Modules/Windows+Unix-Core", "../Modules/Windows-Core+Full", "../Modules/Shared" ], @@ -36,7 +35,6 @@ "Modules/" : { "include": [ "../Modules/Windows-Core", - "../Modules/Windows+Unix-Core", "../Modules/Windows-Core+Full", "../Modules/Shared" ], @@ -50,7 +48,7 @@ "pwrshplugin.pdb", "Install-PowerShellRemoting.ps1", "../../powershell.version" - ], + ] }, "dependencies": { diff --git a/src/powershell-win-full/project.json b/src/powershell-win-full/project.json index 376a7c5dd..b705317d8 100644 --- a/src/powershell-win-full/project.json +++ b/src/powershell-win-full/project.json @@ -51,6 +51,6 @@ "runtimes": { "win7-x64": { }, "win81-x64": { }, - "win10-x64": { }, + "win10-x64": { } } } From 1cc454fbd2bfa98efa9d9252f192558e876edd58 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 16:17:00 -0700 Subject: [PATCH 8/8] Update known issues The "unavailable cmdlets" section was removed pending a comprehensive list compiled from the module declarations. --- docs/KNOWNISSUES.md | 42 +++++++----------------------------------- 1 file changed, 7 insertions(+), 35 deletions(-) diff --git a/docs/KNOWNISSUES.md b/docs/KNOWNISSUES.md index e88697a38..2500c4357 100644 --- a/docs/KNOWNISSUES.md +++ b/docs/KNOWNISSUES.md @@ -37,7 +37,7 @@ The PowerShell jobs fail, see [#1010][]. ## xUnit -The xUnit tests can only be run on Linux. +The xUnit tests are disabled pending implementation of a new runner. ## Console Output @@ -66,47 +66,19 @@ and 3582bb421 for the merge. [#929]: https://github.com/PowerShell/PowerShell/issues/929 -## Unavailable cmdlets +### ExecutionPolicy unavailable on non-Windows platforms -This project includes the CoreCLR versions of the `Commands.Management`, -`Commands.Utility`, `Security`, and `PSDiagnostics` modules. - -The `Archive`, `Diagnostics`, `PSGet`, and `Host` modules are not yet included. - -The `WSMan.Management` module cannot be included unless the -`Management.Infrastructure.Native` library is ported. - -The CoreCLR version of the `Commands.Utility` module does not contain the -following cmdlets that exist in the FullCLR version: - -- ConvertFrom-String -- ConvertTo-Html -- Export-PSSession -- Import-PSSession -- Invoke-RestMethod -- Invoke-WebRequest -- Out-GridView -- Out-Printer -- Send-MailMessage -- Show-Command -- Update-List - -### ExecutionPolicy unavailable on non-Windows platform - -ExecutionPolicy is not implemented on non-Windows platforms and the following related CmdLets will return the error below. - -- Get-ExecutionPolicy -- Set-ExecutionPolicy +ExecutionPolicy is not implemented on non-Windows platforms. +`Get-ExecutionPolicy` will always return `Unrestricted` which is the correct operating mode. +`Set-ExecutionPolicy` will throw `PlatformNotSupported`. ``` Set-ExecutionPolicy : Operation is not supported on this platform. At line:1 char:1 + Set-ExecutionPolicy AllSigned + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - + CategoryInfo : NotSpecified: (:) [Set-ExecutionPolicy], Platfor - mNotSupportedException - + FullyQualifiedErrorId : System.PlatformNotSupportedException,Microsoft.P - owerShell.Commands.SetExecutionPolicyCommand + + CategoryInfo : NotSpecified: (:) [Set-ExecutionPolicy], PlatformNotSupportedException + + FullyQualifiedErrorId : System.PlatformNotSupportedException,Microsoft.PowerShell.Commands.SetExecutionPolicyCommand ```