Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed migration script #90

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open

Fixed migration script #90

wants to merge 6 commits into from

Conversation

IkonikJD
Copy link
Collaborator

I fixed the script that caused the files in the destination to be deleted when doing a migration

# Incrementar el contador de items movidos
$movedItems++
} catch {
Write-Host "Error moving item: $($item.FullName)"

Check warning

Code scanning / PSScriptAnalyzer

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
@@ -131,16 +162,22 @@
Migration_updateSRM $origin $destination

# Recargar las ubicaciones de las partidas guardadas
Write-Host "Reconfigurando los enlaces simbólicos de saves..."

Check warning

Code scanning / PSScriptAnalyzer

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
Get-Command -Name "*_IsInstalled" | ForEach-Object {
$func = $_.Name
Write-Host "Checking emulator: $func"

Check warning

Code scanning / PSScriptAnalyzer

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
if (& $func) {
$setup_func = $func -replace '_IsInstalled$', '_setupSaves'
Write-Host "Setup function: $setup_func"

Check warning

Code scanning / PSScriptAnalyzer

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
if (Get-Command -Name $setup_func -ErrorAction SilentlyContinue) {
Write-Host "Executing: $setup_func"

Check warning

Code scanning / PSScriptAnalyzer

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning

File 'emuDeckMigration.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
if ($old -eq "storagePath") {
$uniqueLines = @()
$found = $false

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
$uniqueLines += $line
}
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

$modifiedContents = $uniqueLines
}

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace

# Escribir el contenido modificado
$modifiedContents | Set-Content $fileToCheck -Encoding UTF8

Check notice

Code scanning / PSScriptAnalyzer

Line has trailing whitespace Note

Line has trailing whitespace
# Escribir el contenido modificado
$modifiedContents | Set-Content $fileToCheck -Encoding UTF8

Write-Host "Updated setting: $old to $new"

Check warning

Code scanning / PSScriptAnalyzer

File 'helperFunctions.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning

File 'helperFunctions.ps1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant