← 返回 Skills 市场
cute-omega

Locate your position on modern Windows

作者 Cute Omega · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
225
总下载
0
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install locate-on-windows
功能描述
Geolocate the current Windows machine using the native WinRT Location API (PowerShell 5.1). No external API keys, no browser, no dependencies — uses Windows....
使用说明 (SKILL.md)

Locate your position on modern Windows

Locate the Windows machine using the built-in WinRT Windows.Devices.Geolocation API.

Usage

Save the script below as geolocate.ps1 and run:

powershell.exe -ExecutionPolicy Bypass -File geolocate.ps1

Returns JSON:

{
  "error": false,
  "message": "ok",
  "latitude": 35.6762,
  "longitude": 139.6503,
  "accuracy_m": 1500,
  "timestamp": "2026-01-01T08:00:00.0000000+09:00"
}

Script

# geolocate.ps1 — Windows Geolocation via WinRT (PowerShell 5.1 only)
Add-Type -AssemblyName "System.Runtime.WindowsRuntime"
[Windows.Devices.Geolocation.Geolocator, Windows.Devices.Geolocation, ContentType=WindowsRuntime] | Out-Null

try {
  $geo = New-Object Windows.Devices.Geolocation.Geolocator
  $geo.DesiredAccuracy = [Windows.Devices.Geolocation.PositionAccuracy]::Default
  $geo.DesiredAccuracyInMeters = 100

  $asyncOp = $geo.GetGeopositionAsync()

  $asTask = [System.WindowsRuntimeSystemExtensions].GetMethods() |
    Where-Object {
      $_.Name -eq 'AsTask' -and
      $_.GetParameters().Count -eq 1 -and
      $_.GetParameters()[0].ParameterType.IsGenericType -and
      $_.GetParameters()[0].ParameterType.Name.StartsWith('IAsyncOperation')
    } | Select-Object -First 1

  if (-not $asTask) {
    $output = [Ordered]@{
      error      = $true
      message    = "Cannot resolve AsTask\x3CT> overload"
      latitude   = 0.0
      longitude  = 0.0
      accuracy_m = 0
      timestamp  = [datetime]::Now.ToString("o")
    }
    Write-Output ($output | ConvertTo-Json)
    exit 1
  }

  $genericMethod = $asTask.MakeGenericMethod([Windows.Devices.Geolocation.Geoposition])
  $task = $genericMethod.Invoke($null, @($asyncOp))
  $task.Wait()
  $pos = $task.Result

  $output = [Ordered]@{
    error      = $false
    message    = "ok"
    latitude   = [math]::Round($pos.Coordinate.Point.Position.Latitude, 6)
    longitude  = [math]::Round($pos.Coordinate.Point.Position.Longitude, 6)
    accuracy_m = $pos.Coordinate.Accuracy
    timestamp  = $pos.Coordinate.Timestamp.ToString("o")
  }
  Write-Output ($output | ConvertTo-Json)
} catch {
  $output = [Ordered]@{
    error      = $true
    message    = $_.Exception.Message
    latitude   = 0.0
    longitude  = 0.0
    accuracy_m = 0
    timestamp  = [datetime]::Now.ToString("o")
  }
  Write-Output ($output | ConvertTo-Json)
  exit 1
}

How It Works

  1. Loads System.Runtime.WindowsRuntime for WinRT type resolution.
  2. Instantiates Windows.Devices.Geolocation.Geolocator.
  3. Calls GetGeopositionAsync() — returns IAsyncOperation\x3CGeoposition>.
  4. Converts to Task\x3CT> via reflection on System.WindowsRuntimeSystemExtensions.AsTask\x3CT>.
  5. Blocks with .Wait() and outputs JSON.

The location source depends on hardware: GPS (if present), WiFi triangulation, or IP fallback. Typical WiFi accuracy is 1–3 km.

Requirements

  • Windows 10+
  • PowerShell 5.1 (powershell.exe, not pwsh 7)
  • Location must be enabled: Settings → Privacy → Location → On
  • No admin rights needed

Reverse Geocoding

Use the coordinates with any free reverse-geocoding service:

curl -s "https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=35.6762&longitude=139.6503"

Troubleshooting

  • "Location access denied": Enable in Windows Settings → Privacy → Location
  • Timeout / no response: The Location service may be disabled or blocked by group policy
  • Accuracy > 10km: No WiFi/GPS available, falling back to IP-based estimate
安全使用建议
This skill is internally consistent with its description: it provides a full PowerShell script that uses Windows' native WinRT Geolocator and requests no credentials. Before running, inspect the script (it's included) and only run it on machines where you trust the source because it requires running powershell.exe with -ExecutionPolicy Bypass. Be aware that the output is the device's precise location — treat it as sensitive data and avoid sending it to external services unless you trust them. If you want to reduce risk, run the script locally rather than allowing autonomous agent invocation, and avoid pasting results into third-party reverse-geocoding APIs unless necessary.
功能分析
Type: OpenClaw Skill Name: locate-on-windows Version: 1.0.1 The skill provides a PowerShell script to retrieve the device's geolocation using the native Windows WinRT API (Windows.Devices.Geolocation). The code is transparent, uses standard reflection techniques for WinRT compatibility in PowerShell 5.1, and contains no hidden exfiltration or malicious logic; an external reverse-geocoding API (api.bigdatacloud.net) is mentioned only as a usage example in SKILL.md.
能力评估
Purpose & Capability
Name/description claim WinRT-based Windows geolocation; the SKILL.md contains a PowerShell 5.1 script that loads System.Runtime.WindowsRuntime and instantiates Windows.Devices.Geolocation. No unrelated environment variables, binaries, or network credentials are requested — this is proportional to the stated capability.
Instruction Scope
The runtime instructions are narrowly scoped to creating and running a PowerShell script that calls GetGeopositionAsync, converts the async result to a Task, and emits JSON. The script does not read other files, request unrelated system data, or transmit results to remote endpoints. Note: it instructs the user to run powershell.exe with -ExecutionPolicy Bypass, which is a common mechanism to run unsigned scripts but increases the risk if the script source is untrusted; the SKILL.md itself contains the full script for review.
Install Mechanism
No install spec and no code files beyond SKILL.md (instruction-only). Nothing is downloaded or written to disk by an installer step. This is the lowest-risk install profile.
Credentials
No environment variables, credentials, or config paths are required. The only sensitive output is device location (coordinates), which is expected for a geolocation utility. The documentation's reverse-geocoding example would send coordinates to a third-party service (external data exfiltration risk if you do that), but that example is optional and clearly labeled.
Persistence & Privilege
The skill does not request persistent presence (always:false) and does not modify other skill or system configurations. The platform default allowing autonomous invocation remains in effect, but this skill does not request elevated privileges or persistent tokens.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install locate-on-windows
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /locate-on-windows 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
- Improved script error handling; script now outputs structured JSON error messages if an error occurs. - Standardized JSON output format to always include "error" and "message" fields alongside latitude, longitude, accuracy, and timestamp. - No code logic changes; functionality remains the same, but output is more reliable and user-friendly.
v1.0.0
Initial release of win-geolocate. - Geolocate your Windows machine using the native WinRT Location API from PowerShell 5.1. - No external dependencies, browser, or API keys required. - Outputs latitude, longitude, accuracy (meters), and timestamp as JSON. - Designed for device-based (not IP-based) geolocation; accuracy depends on available hardware. - Includes troubleshooting tips and reverse geocoding example.
元数据
Slug locate-on-windows
版本 1.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

Locate your position on modern Windows 是什么?

Geolocate the current Windows machine using the native WinRT Location API (PowerShell 5.1). No external API keys, no browser, no dependencies — uses Windows.... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 225 次。

如何安装 Locate your position on modern Windows?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install locate-on-windows」即可一键安装,无需额外配置。

Locate your position on modern Windows 是免费的吗?

是的,Locate your position on modern Windows 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Locate your position on modern Windows 支持哪些平台?

Locate your position on modern Windows 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Locate your position on modern Windows?

由 Cute Omega(@cute-omega)开发并维护,当前版本 v1.0.1。

💬 留言讨论