Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get Genshin Impact wish history link
Copy link

FrenkYang0918 commented Nov 24, 2021

The first line in file "getlink_china.ps1" should be modified to:
$logLocation = "%userprofile%\AppData\LocalLow\miHoYo\$([char]0x539f)$([char]0x795e)\output_log.txt";
Or it won't work.

Copy link

DNScookie commented Nov 24, 2021

don't exit after writing errors

Copy link

XuaTheGrate commented Nov 24, 2021

All branches should have a pause before exiting so the user can read any errors that might occur.

if (-Not [System.IO.File]::Exists($path)) {
    Write-Host "Cannot find the log file! Make sure to open the wish history first!" -ForegroundColor Red

    Write-Host 'Press any key to continue...'
    $null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')

Copy link

FrenkYang0918 commented Nov 24, 2021

Powershell's .ps1 file doesn't support "UTF-8 without BOM", if a .ps1 file has non-ASCII characters (for example: 原神) and saved as "UTF-8 without BOM", it will be displayed as following:
Look at line 1, non-ASCII characters are mojibake, it is unreadable.

Normal string: "原神"
Mojibake string: "鍘熺"

Copy link

ArnoldsK commented Nov 25, 2021

Hello. I'd suggest removing the exit statements.
What is the point of sending the message if you don't see it?
It's confusing when the terminal just closes on a failed run without any message of why.

Copy link

EspadaLorde commented Nov 25, 2021

What's this for? Previous one worked just fine

Copy link

RaSan147 commented Nov 27, 2021

why not using %appdata%/LocalLow instead of %userprofile%\AppData\LocalLow

Copy link

FrenkYang0918 commented Nov 27, 2021

why not using %appdata%/LocalLow instead of %userprofile%\AppData\LocalLow

%appdata% is pointed to C:/Users/{Your User Name}/AppData/Roaming

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment