mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
docs: Update remove-offline-files.md (#6449)
The previous Windows Powershell script didn't work - resulted in a bunch of errors due to multiple reasons. The revised code works as expected.
This commit is contained in:
parent
702e91145a
commit
a7768cc64d
@ -23,11 +23,15 @@ awk -F\" '/entityId/ {print $4}' orphans.json | while read line; do curl --locat
|
||||
|
||||
```
|
||||
Get-Content orphans.json | Select-String -Pattern 'entityId' | ForEach-Object {
|
||||
$line = line=$_ -split '"' | Select-Object -Index 3
|
||||
Invoke-RestMethod -Uri 'http://YOUR_IP_HERE:2283/api/asset' -Method Delete -Headers @{
|
||||
'Content-Type' = 'application/json'
|
||||
'x-api-key' = 'YOUR_API_KEY_HERE'
|
||||
} -Body "{"force": true, "ids": ["$line"]}"
|
||||
$line = $_ -split '"' | Select-Object -Index 3
|
||||
$body = [pscustomobject]@{
|
||||
'ids' = @($line)
|
||||
'force' = (' true ' | ConvertFrom-Json)
|
||||
} | ConvertTo-Json -Depth 3
|
||||
Invoke-RestMethod -Uri 'http://YOUR_IP_HERE:2283/api/asset' -Method Delete -Headers @{
|
||||
'Content-Type' = 'application/json'
|
||||
'x-api-key' = 'YOUR_API_KEY_HERE'
|
||||
} -Body $body
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user