Linux Powershell

gisliScriptingLeave a Comment

As you may know that Microsoft has released Powershell on linux a few months ago but I have not been able to test it, so I decided to try it out. I installed Ubuntu 64bit 16.04 and tried to figure out how to install Powershell. I noticed that Microsoft has said that they have released Powershell for linux and mac but they did not mention that it was an alpha version. Anyways I ran the following command

wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-alpha.9/powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb
chmod +x powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb
sudo dpkg -i powershell_6.0.0-alpha.9-1ubuntu1.16.04.1_amd64.deb

This command lines installed powershell and I was able to run powershell, just by typing “powershell” in terminal. After a few minutes working with Powershell in linux I noticed that it was not quite ready at least managing linux with Powershell. There is a Desired State Configuration there but what I am looking for is not available i.e. wmi commands. Here is a list of commands in linux you can use :

Add-NodeKeys
AddDscResourceProperty
AddDscResourcePropertyFromMetadata
AfterAll
AfterEach
Assert-MockCalled
Assert-VerifiableMocks
BeforeAll
BeforeEach
cd..
cd\
CheckResourceFound
Clear-Host
Compress-Archive
Configuration
Context
ConvertTo-MOFInstance
Describe
Expand-Archive
Find-Command
Find-DscResource
Find-Module
Find-RoleCapability
Find-Script
Format-Hex
Generate-VersionInfo
Get-CompatibleVersionAddtionaPropertiesStr
Get-ComplexResourceQualifier
Get-ConfigurationErrorCount
Get-DscResource
Get-DSCResourceModules
Get-EncryptedPassword
Get-FileHash
Get-InnerMostErrorRecord
Get-InstalledModule
Get-InstalledScript
Get-MockDynamicParameters
Get-MofInstanceName
Get-MofInstanceText
Get-PositionInfo
Get-PSCurrentConfigurationNode
Get-PSDefaultConfigurationDocument
Get-PSMetaConfigDocumentInstVersionInfo
Get-PSMetaConfigurationProcessed
Get-PSRepository
Get-PSTopConfigurationName
Get-PublicKeyFromFile
Get-PublicKeyFromStore
Get-TestDriveItem
Get-Verb
GetCompositeResource
GetImplementingModulePath
GetModule
GetPatterns
GetResourceFromKeyword
GetSyntax
help
Import-PowerShellDataFile
ImportCimAndScriptKeywordsFromModule
ImportClassResourcesFromModule
ImportSystemModules
In
Initialize-ConfigurationRuntimeState
InModuleScope
Install-Module
Install-Script
Invoke-Mock
Invoke-Pester
IsHiddenResource
IsPatternMatched
It
Mock
more
New-DscChecksum
New-Fixture
New-Guid
New-ScriptFileInfo
New-TemporaryFile
Node
oss
Pause
prompt
PSConsoleHostReadline
Publish-Module
Publish-Script
ReadEnvironmentFile
Register-PSRepository
Save-Module
Save-Script
Set-DynamicParameterVariables
Set-NodeExclusiveResources
Set-NodeManager
Set-NodeResources
Set-NodeResourceSource
Set-PSCurrentConfigurationNode
Set-PSDefaultConfigurationDocument
Set-PSMetaConfigDocInsProcessedBeforeMeta
Set-PSMetaConfigVersionInfoV2
Set-PSRepository
Set-PSTopConfigurationName
Setup
Should
StrongConnect
TabExpansion2
Test-ConflictingResources
Test-ModuleReloadRequired
Test-MofInstanceText
Test-NodeManager
Test-NodeResources
Test-NodeResourceSource
Test-ScriptFileInfo
ThrowError
Uninstall-Module
Uninstall-Script
Unregister-PSRepository
Update-ConfigurationDocumentRef
Update-ConfigurationErrorCount
Update-DependsOn
Update-LocalConfigManager
Update-Module
Update-ModuleManifest
Update-ModuleVersion
Update-Script
Update-ScriptFileInfo
ValidateNoCircleInNodeResources
ValidateNodeExclusiveResources
ValidateNodeManager
ValidateNodeResources
ValidateNodeResourceSource
ValidateNoNameNodeResources
ValidateUpdate-ConfigurationData
Write-Log
Write-MetaConfigFile
Write-NodeMOFFile
WriteFile
Add-Content
Add-History
Add-Member
Add-Type
Clear-Content
Clear-History
Clear-Item
Clear-ItemProperty
Clear-Variable
Compare-Object
Connect-PSSession
Convert-Path
ConvertFrom-Csv
ConvertFrom-Json
ConvertFrom-SecureString
ConvertFrom-StringData
ConvertTo-Csv
ConvertTo-Json
ConvertTo-SecureString
ConvertTo-Xml
Copy-Item
Copy-ItemProperty
Debug-Job
Debug-Process
Debug-Runspace
Disable-PSBreakpoint
Disable-PSSessionConfiguration
Disable-RunspaceDebug
Disconnect-PSSession
Enable-PSBreakpoint
Enable-PSSessionConfiguration
Enable-RunspaceDebug
Enter-PSHostProcess
Enter-PSSession
Exit-PSHostProcess
Exit-PSSession
Export-Alias
Export-Clixml
Export-Csv
Export-FormatData
Export-ModuleMember
Find-Package
Find-PackageProvider
ForEach-Object
Format-Custom
Format-List
Format-Table
Format-Wide
Get-Alias
Get-ChildItem
Get-Command
Get-Content
Get-Credential
Get-Culture
Get-Date
Get-Event
Get-EventSubscriber
Get-ExecutionPolicy
Get-FormatData
Get-Help
Get-History
Get-Host
Get-Item
Get-ItemProperty
Get-ItemPropertyValue
Get-Job
Get-Location
Get-Member
Get-Module
Get-Package
Get-PackageProvider
Get-PackageSource
Get-Process
Get-PSBreakpoint
Get-PSCallStack
Get-PSDrive
Get-PSHostProcessInfo
Get-PSProvider
Get-PSReadlineKeyHandler
Get-PSReadlineOption
Get-PSSession
Get-PSSessionCapability
Get-PSSessionConfiguration
Get-Random
Get-Runspace
Get-RunspaceDebug
Get-TraceSource
Get-TypeData
Get-UICulture
Get-Unique
Get-Variable
Group-Object
Import-Alias
Import-Clixml
Import-Csv
Import-LocalizedData
Import-Module
Import-PackageProvider
Install-Package
Install-PackageProvider
Invoke-Command
Invoke-Expression
Invoke-History
Invoke-Item
Invoke-RestMethod
Invoke-WebRequest
Join-Path
Measure-Command
Measure-Object
Move-Item
Move-ItemProperty
New-Alias
New-Event
New-Item
New-ItemProperty
New-Module
New-ModuleManifest
New-Object
New-PSDrive
New-PSRoleCapabilityFile
New-PSSession
New-PSSessionConfigurationFile
New-PSSessionOption
New-PSTransportOption
New-TimeSpan
New-Variable
Out-Default
Out-File
Out-Host
Out-Null
Out-String
Pop-Location
Push-Location
Read-Host
Receive-Job
Receive-PSSession
Register-ArgumentCompleter
Register-EngineEvent
Register-ObjectEvent
Register-PackageSource
Register-PSSessionConfiguration
Remove-Event
Remove-Item
Remove-ItemProperty
Remove-Job
Remove-Module
Remove-PSBreakpoint
Remove-PSDrive
Remove-PSReadlineKeyHandler
Remove-PSSession
Remove-TypeData
Remove-Variable
Rename-Item
Rename-ItemProperty
Resolve-Path
Save-Help
Save-Package
Select-Object
Select-String
Select-Xml
Set-Alias
Set-Content
Set-Date
Set-ExecutionPolicy
Set-Item
Set-ItemProperty
Set-Location
Set-PackageSource
Set-PSBreakpoint
Set-PSDebug
Set-PSReadlineKeyHandler
Set-PSReadlineOption
Set-PSSessionConfiguration
Set-StrictMode
Set-TraceSource
Set-Variable
Sort-Object
Split-Path
Start-Job
Start-Process
Start-Sleep
Start-Transcript
Stop-Job
Stop-Process
Stop-Transcript
Tee-Object
Test-ModuleManifest
Test-Path
Test-PSSessionConfigurationFile
Trace-Command
Uninstall-Package
Unregister-Event
Unregister-PackageSource
Unregister-PSSessionConfiguration
Update-FormatData
Update-Help
Update-TypeData
Wait-Debugger
Wait-Event
Wait-Job
Wait-Process
Where-Object
Write-Debug
Write-Error
Write-Host
Write-Information
Write-Output
Write-Progress
Write-Verbose
Write-Warning

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.