From 280bd651c17e167fc36157c706325ca12f1f4123 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Tue, 9 Aug 2016 15:08:53 -0700 Subject: [PATCH] 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 acefbaa1d8..45fa2f9c35 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 0000000000..f53f4177c0 --- /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 + } + } +}