commit 70195283098182a67a4c2ed5ae01152d1b2c7734
parent c89f20aa45a625d7c2da91ede83749455bd67356
Author: Asher Morgan <asher@ashermorgan.net>
Date: Wed, 16 Sep 2026 19:58:39 -0700
Use irm instead of iwr on Windows
Diffstat:
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
@@ -84,11 +84,11 @@ Options:
<opts> Any (server-approved) ansible-playbook(1) options
```
-Windows clients are also supported. Just use `Invoke-WebRequest` instead of
-`curl`.
+Windows clients are also supported. Just use the `Invoke-RestMethod` cmdlet
+instead of `curl`.
```
-PS> (Invoke-WebRequest http://<server IP>:8000).Content | python
+PS> irm http://<server IP>:8000 | python
```
Finally, stop the AoH server when you're done using it.
diff --git a/aoh/client.py b/aoh/client.py
@@ -296,11 +296,9 @@ def cli(args):
if '-h' in args or '--help' in args:
if len(args) >= 1 and args[0] != '-':
prog = args[0]
- elif sys.platform == 'win32':
- prog = f'(Invoke-WebRequest {AOH_ORIGIN}/run).Content | ' \
- f'{os.path.basename(sys.executable)} -'
else:
- prog = f'curl -s {AOH_ORIGIN}/run | ' \
+ curl = 'irm' if sys.platform == 'win32' else 'curl -s'
+ prog = f'{curl} {AOH_ORIGIN}/run | ' \
f'{os.path.basename(sys.executable)} -'
# Note: changes to this message should also be applied to README.md
diff --git a/aoh/templates/home.html b/aoh/templates/home.html
@@ -19,7 +19,7 @@
{% endif %}
{% if is_windows %}
- {% set cmd = '(Invoke-WebRequest %s/run).Content' % AOH_ORIGIN %}
+ {% set cmd = 'irm %s/run' % AOH_ORIGIN %}
{% else %}
{% set cmd = 'curl -s %s/run' % AOH_ORIGIN %}
{% endif %}