--- title: "How to check Windows update via device script" slug: "how-to-check-windows-update-via-device-script" updated: 2025-12-01T00:56:04Z published: 2025-12-01T00:56:04Z canonical: "support.appgate.com/how-to-check-windows-update-via-device-script" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.appgate.com/llms.txt > Use this file to discover all available pages before exploring further. # How to check Windows update via device script This article will show you how to check windows update for certain days via device script. We will use powershell script as below ```powershell $LastUpdate = (Get-Hotfix | Sort InstalledOn -desc)[0].InstalledOn $LastUpdate -gt (get-date).AddDays(-90) ``` You can change **(-90)** to any number you think is suitable for your use case. Start by uploading the PS script to **Device Claim Scripts** ![](https://cdn.us.document360.io/e7482ce5-acfa-4c3b-b76c-b6c32472644a/Images/Documentation/how-to-check-windows-update-via-device-script-image-krx296mm.png?sv=2026-02-06&spr=https&st=2026-10-27T02%3A09%3A39Z&se=2026-10-27T03%3A09%3A39Z&sr=c&sp=r&sig=KKxFqSslz00FHwVkYObXA71AjFOTJ5ALQlciSoin3to%3D)![](https://cdn.us.document360.io/e7482ce5-acfa-4c3b-b76c-b6c32472644a/Images/Documentation/how-to-check-windows-update-via-device-script-image-ocixfqkb.png?sv=2026-02-06&spr=https&st=2026-10-27T02%3A09%3A39Z&se=2026-10-27T03%3A09%3A39Z&sr=c&sp=r&sig=KKxFqSslz00FHwVkYObXA71AjFOTJ5ALQlciSoin3to%3D) **Claim Name** can be anything you want**.** All you need now is to use it in the Policy or Condition. ![](https://cdn.us.document360.io/e7482ce5-acfa-4c3b-b76c-b6c32472644a/Images/Documentation/how-to-check-windows-update-via-device-script-image-jbfoidxa.png?sv=2026-02-06&spr=https&st=2026-10-27T02%3A09%3A39Z&se=2026-10-27T03%3A09%3A39Z&sr=c&sp=r&sig=KKxFqSslz00FHwVkYObXA71AjFOTJ5ALQlciSoin3to%3D) ![](https://cdn.us.document360.io/e7482ce5-acfa-4c3b-b76c-b6c32472644a/Images/Documentation/how-to-check-windows-update-via-device-script-image-ujcwz0g9.png?sv=2026-02-06&spr=https&st=2026-10-27T02%3A09%3A39Z&se=2026-10-27T03%3A09%3A39Z&sr=c&sp=r&sig=KKxFqSslz00FHwVkYObXA71AjFOTJ5ALQlciSoin3to%3D)