feat: Add import/export device settings utils for PS5#43
feat: Add import/export device settings utils for PS5#43tustanivsky wants to merge 2 commits intomainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Duplicate settings export logic bypasses new wrapper
- Replaced direct InvokeCommand('settingsexport') call with ExportSettings() method in PlayStation5Provider.GetDiagnostics().
Or push these changes by commenting:
@cursor push 844694767a
Preview (844694767a)
diff --git a/app-runner/Private/DeviceProviders/PlayStation5Provider.ps1 b/app-runner/Private/DeviceProviders/PlayStation5Provider.ps1
--- a/app-runner/Private/DeviceProviders/PlayStation5Provider.ps1
+++ b/app-runner/Private/DeviceProviders/PlayStation5Provider.ps1
@@ -191,7 +191,7 @@
# Run prospero-ctrl settings export
try {
$settingsFile = Join-Path $OutputDirectory "$datePrefix-settings.xml"
- $this.InvokeCommand('settingsexport', @($settingsFile))
+ $this.ExportSettings($settingsFile)
$results.Files += $settingsFile
Write-Debug "Settings exported to: $settingsFile"
} catch {| 'ipconfig' = @($this.TargetControlTool, 'network ip-config') | ||
| 'natinfo' = @($this.TargetControlTool, 'network get-nat-traversal-info') | ||
| 'settingsexport' = @($this.TargetControlTool, 'settings export "{0}"') | ||
| 'settingsimport' = @($this.TargetControlTool, 'settings import "{0}"') |
There was a problem hiding this comment.
Duplicate settings export logic bypasses new wrapper
Low Severity
The PlayStation5Provider.GetDiagnostics() method directly calls $this.InvokeCommand('settingsexport', @($settingsFile)) instead of using the newly introduced $this.ExportSettings($settingsFile) method. This PR introduced ExportSettings to centralize this logic, but the existing inline call in GetDiagnostics was not updated, leaving two parallel code paths for the same operation. Any future changes made to ExportSettings (e.g., validation, pre/post-processing) won't automatically apply to the diagnostics export path.



This PR adds two new public functions (
Export-DeviceSettingsandImport-DeviceSettings) that expose theprospero-ctrlsettings export and settings import commands for connected PlayStation 5 devkits.Key changes:
settingsimportcommand toPlayStation5ProviderExportSettings()andImportSettings()methods to the baseDeviceProviderclassExport-DeviceSettingsandImport-DeviceSettingspublic functionsRelated items:
#skip-changelog