# Troubleshooting

LLMS index: [llms.txt](/v1.2.1.0/llms.txt)

---

Use this guide when PackageUpdateInfo does not return expected results, skips
checks, or fails to import and export data.

## Get actionable diagnostics first

Run with verbose output:

```powershell
Get-PackageUpdateInfo -Verbose
```

Validate settings and rules:

```powershell
Get-PackageUpdateSetting
Get-PackageUpdateRule -IncludeDefaultRule
```

## Check is skipped unexpectedly

Symptom:

- You see a warning that update checks are skipped because the check interval
  is not expired.

Cause:

- `UpdateCheckInterval` and recent `LastCheck` or `LastSuccessfulCheck` are
  preventing a new online check.

Resolution:

```powershell
Get-PackageUpdateInfo -Force
```

Or reduce the interval:

```powershell
Set-PackageUpdateSetting -UpdateCheckInterval (New-TimeSpan -Minutes 30)
```

## Configuration file is missing or corrupted

Symptom:

- `Get-PackageUpdateSetting` warns that the module configuration file was not
  found, then throws.

Cause:

- Configuration file path does not exist or contains invalid JSON.

Resolution:

```powershell
Set-PackageUpdateSetting -Reset
Get-PackageUpdateSetting
```

## No modules are returned

Symptom:

- `Get-PackageUpdateInfo` returns nothing even though modules are installed.

Common causes:

- Include and exclude rules filter all modules.
- `-CurrentUser` or `-AllUsers` filters out the modules you expect.
- Repository filtering excludes the relevant modules.

Resolution steps:

```powershell
Get-PackageUpdateRule -IncludeDefaultRule
Get-PackageUpdateInfo -Force
Get-PackageUpdateInfo -CurrentUser -Force
Get-PackageUpdateInfo -AllUsers -Force
```

## Export fails with path errors

Symptom:

- Export reports invalid path or directory issues.

Cause:

- `-Path` points to a directory or a non-existing location without `-Force`.

Resolution:

```powershell
Get-PackageUpdateInfo | Export-PackageUpdateInfo -Path "$HOME\PackageUpdateInfo\updates.xml" -Force
```

## Import returns no data

Symptom:

- `Import-PackageUpdateInfo` returns nothing.

Common causes:

- The file is empty or too small to contain records.
- `-InputFormat` does not match the exported format.
- Wrong file path for current runtime and edition.

Resolution:

```powershell
Import-PackageUpdateInfo -InputFormat XML -Verbose
Import-PackageUpdateInfo -Path "$HOME\PackageUpdateInfo\updates.json" -InputFormat JSON
```

## Toast notifications do not appear

Symptom:

- `-ShowToastNotification` is used, but no toast appears.

Common causes:

- BurntToast is not installed.
- Host platform does not support Windows toast notifications.
- No module in the result has `NeedUpdate = $true`.

Resolution:

```powershell
Install-Module BurntToast -Scope CurrentUser
Get-PackageUpdateInfo -ShowOnlyNeededUpdate -ShowToastNotification -Force
```

## Rules cannot be added or modified

Symptom:

- Adding a rule fails with duplicate Id, include, or exclude values.

Cause:

- Existing custom rules already contain the same identifiers or patterns.

Resolution:

```powershell
Get-PackageUpdateRule
Add-PackageUpdateRule -IncludeModuleForChecking "MyModule.*"
Set-PackageUpdateRule -Id 1 -ReportChangeOnRevision $false
Remove-PackageUpdateRule -Id 1
```

## Repository and network issues

Symptom:

- Online version lookup fails or is incomplete.

Common causes:

- Repository is not registered or unreachable.
- Temporary network issues.

Resolution:

```powershell
Get-PSRepository
Find-Module PackageUpdateInfo -Repository PSGallery
Get-PackageUpdateInfo -Repository PSGallery -Force
```

## Recovery flow

If behavior remains inconsistent, use this reset sequence:

```powershell
Set-PackageUpdateSetting -Reset
Get-PackageUpdateInfo -Force | Export-PackageUpdateInfo
Import-PackageUpdateInfo
```
