codewario
codewario

Reputation: 21418

On Windows platforms, can Powershell Core use Windows Powershell specific features?

There are several features of Windows Powershell that are not supported in Powershell Core. Since Powershell Core is being actively developed in favor of Windows Powershell, on a Windows platform can Powershell Core use Windows Powershell modules that have not yet been ported to Powershell Core?

Most notably I am concerned with making sure Powershell Core can work with COM objects and Powershell Remoting (over WinRM).

Upvotes: 0

Views: 100

Answers (1)

Richard Siddaway
Richard Siddaway

Reputation: 451

To answer your specific questions first

PowerShell Core CAN use WinRM remoting for Windows to Windows remoting scenarios. Use it in exactly the same way as Windows PowerShell. WinRM remoting is available from Linux machines to Windows machines but is still a work in progress. if your remoting scenario involves a Linux system you're better off using SSH remoting

You can use COM objects (on Windows systems only) for instance this works:

$xl = New-Object -comobject 'Excel.Application'
$xl.visible = $true
$xlbooks =$xl.workbooks
$wkbk = $xlbooks.Add()
$sheet = $wkbk.WorkSheets.Item(1)

With regard to modules some modules will work under PowerShell core - for instance the networking modules and the storage modules. if its a binary module such as Active Directory then it won't work. At least some of the binary modules, including AD, are being converted to work with PowerShell core. if you look in the module folder and it has CDXML files it should work under PowerShell core.

You could also use implicit remoting to get a module to work. Create a powershell remoting session to the local machine and import the module through the remoting session.

PowerShell core is still very much a work in progress and the number of modules that work with it will increase with time. If in doubt you'll have to test

Upvotes: 1

Related Questions