06-01-2023, 03:52 AM
(This post was last modified: 06-01-2023, 04:05 AM by OneAngryGamer.)
I keep having difficulty converting P8 extensions to work in P10.
I would welcome tips from any P8 developer who has successfully converted their extensions to P9/10. Any difficulties you encountered and what their solution was could end up being very useful to me.
My limited understanding of the changes I need to make when converting:
What I am currently having difficulty with is when you have applied all of the above changes and the code still will not work on P10.
To give an example, I take what is probably the most simple P8 extension I have created here and I make the changes from ps1 to psm1 etc. but when I try to run this in P10, it doesn't work. The log message is:
I would welcome tips from any P8 developer who has successfully converted their extensions to P9/10. Any difficulties you encountered and what their solution was could end up being very useful to me.
My limited understanding of the changes I need to make when converting:
- rename ps1 scripts to psm1
- most of the P8 single value fields (e.g. region) are now multi value. So rework code to use -contains instead of -eq
- Platform names have changed. Some have been dropped, new ones have been added, some have been renamed. So any code that references renamed platforms needs to use the new P10 values.
What I am currently having difficulty with is when you have applied all of the above changes and the code still will not work on P10.
To give an example, I take what is probably the most simple P8 extension I have created here and I make the changes from ps1 to psm1 etc. but when I try to run this in P10, it doesn't work. The log message is:
Quote:ERROR|GameMenu:Game menu extension action failed.
System.Management.Automation.PSArgumentNullException: Cannot process argument because the value of argument "commandInfo" is null. Change the value of argument "commandInfo" to a non-null value.
at System.Management.Automation.PowerShell.AddCommand(CommandInfo commandInfo)
at Playnite.Scripting.PowerShell.PowerShellRuntime.InvokeFunction(String name, List`1 arguments) in C:\projects\playnite\source\Playnite\Scripting\PowerShell\PowerShell.cs:line 271
at Playnite.Scripting.PowerShell.PowerShellScript.InvokeFunction(String functionName, List`1 arguments) in C:\projects\playnite\source\Playnite\Scripting\PowerShell\PowerShellScript.cs:line 208
at Playnite.DesktopApp.Controls.GameMenu.<>c__DisplayClass31_2.<AddExtensionItems>b__0(GameMenuItemActionArgs a) in C:\projects\playnite\source\Playnite.DesktopApp\Controls\Menus\GameMenu.cs:line 606
at Playnite.DesktopApp.Controls.GameMenu.<>c__DisplayClass31_3.<AddExtensionItems>b__1(Object _, RoutedEventArgs __) in C:\projects\playnite\source\Playnite.DesktopApp\Controls\Menus\GameMenu.cs:line 652