Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

-ComObject should not be exposed on systems where it is not supported #4897

Copy link
Copy link
@JeremyBidet

Description

@JeremyBidet
Issue body actions

Hello everybody, i am encountering an issue.
I need to convert some old XML files (encoded with word 2006 .xml schema) as PDF.
I already used PowerShell and ComObject to do this on a Windows system :

$word = New-Object -ComObject Word.Application
$word.Documents.Open($filename).SaveAs($filename.replace(".xml", ".pdf"), 17)

but now I have to automate this process on a Linux system (every XML files are generated onto).
PowerShell on Linux able to me to use these commands but not ComObject due to a missing of api-ms-win-core-com-l1-1-0.dll

Is there any way to load this dll into a Linux system ? If not, is there any other way to do the same ?

Command

$word = New-Object -ComObject Word.Application

Expected behavior


Actual behavior

New-Object : Unable to load DLL 'api-ms-win-core-com-l1-1-0.dll': The specified module or one of its dependencies could not be found.
 (Exception from HRESULT: 0x8007007E)
At line:1 char:9
+ $word = New-Object -ComObject Word.application
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-Object], DllNotFoundException
    + FullyQualifiedErrorId : System.DllNotFoundException,Microsoft.PowerShell.Commands.NewObjectCommand

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-beta
PSEdition                      Core
GitCommitId                    v6.0.0-beta.7
OS                             Linux 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:42:33 UTC 2016
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Enginecore PowerShell engine, interpreter, and runtimecore PowerShell engine, interpreter, and runtime

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.