mirror of
https://github.com/immich-app/immich.git
synced 2025-01-28 06:32:44 +01: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
1 changed files with 9 additions and 5 deletions
|
@ -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 {
|
Get-Content orphans.json | Select-String -Pattern 'entityId' | ForEach-Object {
|
||||||
$line = line=$_ -split '"' | Select-Object -Index 3
|
$line = $_ -split '"' | Select-Object -Index 3
|
||||||
Invoke-RestMethod -Uri 'http://YOUR_IP_HERE:2283/api/asset' -Method Delete -Headers @{
|
$body = [pscustomobject]@{
|
||||||
'Content-Type' = 'application/json'
|
'ids' = @($line)
|
||||||
'x-api-key' = 'YOUR_API_KEY_HERE'
|
'force' = (' true ' | ConvertFrom-Json)
|
||||||
} -Body "{"force": true, "ids": ["$line"]}"
|
} | 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 a new issue