我正在嘗試使用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