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 ``` 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..16b1f5aad --- /dev/null +++ b/src/Modules/Unix/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 @@ -0,0 +1,52 @@ +@{ +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' +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", + "Set-Content", + "Set-ItemProperty") +} 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..45fa2f9c3 --- /dev/null +++ b/src/Modules/Unix/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 @@ -0,0 +1,30 @@ +@{ +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", + "Get-Runspace", "Debug-Runspace", "Enable-RunspaceDebug", "Disable-RunspaceDebug", + "Get-RunspaceDebug", "Wait-Debugger" +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/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 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 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": { } } } 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 + } + } +} 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 + } + } +}