我正在尝试使用Microsoft桌面应用转换器(AKA Desktop Bridge),并且我们的发布者名称中包含逗号,空格和句点。如何在Powershell中指定复杂的发布者名称?
例如。 CN="Acme, Inc."
这不起作用:
DesktopAppConverter.exe -Installer .\Installer.msi -Destination AppxFolder -PackageName "AcmeApp" -Publisher "CN=Acme, Inc." -Version 1.0.0.0 -MakeAppx
我已经想尽各种办法逃避像引号:
-Publisher "CN=\`"Acme`, Inc.\`""
结果:
A positional parameter cannot be found that accepts argument 'Inc.'.
此:
-Publisher 'CN="Acme, Inc."'
个
结果:
Appx manifest validation failed because of an invalid input: 'Publisher' cannot be assigned a value 'CN=Acme, Inc.' Original Error: 'Exception calling "SetPackageIdentityPublisher" with "1" argument(s): "Validating AppxManifest.xml against schemas failed with error(s): Error found in XML (0): The 'Publisher' attribute is invalid - The value 'CN=Acme, Inc.' is invalid according to its datatype 'http://schemas.microsoft.com/appx/manifest/types:ST_Publisher_2010_v2' - The Pattern constraint failed.
此:
-Publisher 'CN="Acme\`, Inc."'
结果:
Appx manifest validation failed because of an invalid input: 'Publisher' cannot be assigned a value 'CN=Acme`, Inc.' Original Error: 'Exception calling "SetPackageIdentityPublisher" with "1" argument(s): "Validating AppxManifest.xml against schemas failed with error(s):
Error found in XML (0): The 'Publisher' attribute is invalid - The value 'CN=Acme`, Inc.' is invalid according to its datatype 'http://schemas.microsoft.com/appx/manifest/types:ST_Publisher_2010_v2' - The Pattern constraint failed.
此:
-Publisher "CN=Acme, Inc."
结果在:
Appx manifest validation failed because of an invalid input: 'Publisher' cannot be assigned a value 'CN=Acme, Inc.' Original Error: 'Exception calling "SetPackageIdentityPublisher" with "1" argument(s): "Validating AppxManifest.xml against schemas failed with error(s): Error found in XML (0): The 'Publisher' attribute is invalid - The value 'CN=Acme, Inc.' is invalid according to its datatype ' http://schemas.microsoft.com/appx/manifest/types:ST_Publisher_2010_v2 ' - The Pattern constraint failed.
此:
-Publisher "CN='Acme\, Inc.'"
结果:
A positional parameter cannot be found that accepts argument 'System.Object[]'.
此:
-Publisher "CN=Acme\, Inc."
结果:
Appx manifest validation failed because of an invalid input: 'Publisher' cannot be assigned a value 'CN=Acme\, Inc.' Original Error: 'Exception calling "SetPackageIdentityPublisher" with "1" argument(s): "Validating AppxManifest.xml against schemas failed with error(s): Error found in XML (0): The 'Publisher' attribute is invalid - The value 'CN=Acme\, Inc.' is invalid according to its datatype ' http://schemas.microsoft.com/appx/manifest/types:ST_Publisher_2010_v2 ' - The Pattern constraint failed.
这非常烦人,因为我们需要完全设置发布者名称,否则签名将无法正常工作,因为它与我们的代码签名证书中的发布者名称不匹配。
这样做的正确方法是什么?
当我尝试获得:C:\ Program Files \ WindowsApps \ Microsoft.DesktopAppConverter_1.0.0.0_x64__8wekyb3d8bbwe \ DesktopAppConverter.ps1:无法找到接受参数'Inc.'的位置参数。 – mikecousins
你从PowerShell运行过吗? –
我从Powershell的DesktopAppConverter应用程序运行它。 – mikecousins