Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app-runner/Private/DeviceProviders/DeviceProvider.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ SDK Path: $($this.SdkPath)
return "$($this.Platform) ($(Get-Date -Format 'HH:mm:ss'))"
}

[void] ExportSettings([string]$OutputFile) {
$this.LogNotImplemented('ExportSettings')
}

[void] ImportSettings([string]$InputFile) {
$this.LogNotImplemented('ImportSettings')
}

[bool] TestInternetConnection() {
Write-Debug "$($this.Platform): Testing internet connection"
$this.LogNotImplemented('TestInternetConnection')
Expand Down
13 changes: 12 additions & 1 deletion app-runner/Private/DeviceProviders/PlayStation5Provider.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class PlayStation5Provider : DeviceProvider {
'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}"')
'processlist' = @($this.TargetControlTool, 'process list', { $Input | ConvertFrom-Yaml })
# Target management commands for DetectAndSetDefaultTarget()
'get-default-target' = @($this.TargetControlTool, 'target get-default')
Expand Down Expand Up @@ -147,6 +148,16 @@ class PlayStation5Provider : DeviceProvider {
})
}

[void] ExportSettings([string]$OutputFile) {
Write-Debug "$($this.Platform): Exporting settings to: $OutputFile"
$this.InvokeCommand('settingsexport', @($OutputFile))
}

[void] ImportSettings([string]$InputFile) {
Write-Debug "$($this.Platform): Importing settings from: $InputFile"
$this.InvokeCommand('settingsimport', @($InputFile))
}

[hashtable] GetDiagnostics([string]$OutputDirectory) {
# Call base implementation to collect standard diagnostics
$results = ([DeviceProvider]$this).GetDiagnostics($OutputDirectory)
Expand Down Expand Up @@ -190,7 +201,7 @@ class PlayStation5Provider : DeviceProvider {
# 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 {
Expand Down
33 changes: 33 additions & 0 deletions app-runner/Public/Export-DeviceSettings.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function Export-DeviceSettings {
<#
.SYNOPSIS
Exports the settings of the connected device to a file.

.DESCRIPTION
Exports the current settings of the connected device to an XML file.
Uses the current device session.

.PARAMETER OutputFile
Path to the output XML file where settings will be saved.

.EXAMPLE
Connect-Device -Platform "PlayStation5"
Export-DeviceSettings -OutputFile "settings.xml"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$OutputFile
)

Assert-DeviceSession

Write-Debug "Exporting device settings: $($script:CurrentSession.Platform)"
Write-Debug "Output file: $OutputFile"

$provider = $script:CurrentSession.Provider
$provider.ExportSettings($OutputFile)

Write-Output "Settings exported to: $OutputFile"
}
33 changes: 33 additions & 0 deletions app-runner/Public/Import-DeviceSettings.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
function Import-DeviceSettings {
<#
.SYNOPSIS
Imports settings from a file to the connected device.
.DESCRIPTION
Imports settings from an XML file to the connected device.
Uses the current device session.
.PARAMETER InputFile
Path to the input XML file containing settings to import.
.EXAMPLE
Connect-Device -Platform "PlayStation5"
Import-DeviceSettings -InputFile "settings.xml"
#>
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]$InputFile
)

Assert-DeviceSession

Write-Debug "Importing device settings: $($script:CurrentSession.Platform)"
Write-Debug "Input file: $InputFile"

$provider = $script:CurrentSession.Provider
$provider.ImportSettings($InputFile)

Write-Output "Settings imported from: $InputFile"
}
2 changes: 2 additions & 0 deletions app-runner/SentryAppRunner.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
'Connect-Device',
'Copy-DeviceItem',
'Disconnect-Device',
'Export-DeviceSettings',
'Import-DeviceSettings',
'Get-DeviceDiagnostics',
'Get-DeviceLogs',
'Get-DeviceScreenshot',
Expand Down
6 changes: 5 additions & 1 deletion app-runner/SentryAppRunner.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,9 @@ Export-ModuleMember -Function @(
'Get-DeviceLogs',
'Get-DeviceScreenshot',
'Get-DeviceDiagnostics',
'Copy-DeviceItem'
'Copy-DeviceItem',

# Settings Management
'Export-DeviceSettings',
'Import-DeviceSettings'
)