惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
美团技术团队
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
T
Tailwind CSS Blog
D
Docker
博客园 - Franky
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
腾讯CDC
Vercel News
Vercel News
Engineering at Meta
Engineering at Meta
U
Unit 42
The Cloudflare Blog
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
爱范儿
爱范儿
Recent Announcements
Recent Announcements
博客园 - 聂微东
博客园 - 叶小钗
H
Help Net Security
MyScale Blog
MyScale Blog

博客园 - iDEAAM

logstash 如何从oracle 导入 pgsql IIS如何部署python django项目 IIS 如何部署net8 和 如何配置反向代理 ARR、URL Rewrite python 备份文件,从 D盘 到Z盘。并且保留15天的文件 git 如何排除 bin obj nginx 配置 自签名https证书 使用nssm在windows服务器上部署nodejs 退出远程桌面不锁屏 PDF 转 Excel 非常完美的java包 sublime 选择有规律的数据,同时快速编辑多行内容 去除重复行或者只保留唯一值 C#中 同步方法调用异步方法不死锁的方法 async await task windows 2008 r2 iis https 配置方法 vue js中,利用json数据临时生成一个可下载csv的功能 git常用命令 C#下载远程文件并打包 从 ASP.NET MVC 和 Web API 升级到 ASP.NET Core MVC c# 把现有图片顶部top50px 处理成白色 C# asp.net开源插件推荐:PdfiumViewer ( pdf 转成 图片png pdf convert to image ) 在asp.net mvc中使用了owin startup如何使用 swagger插件
powershell 计划任务 定时任务 如何调用get接口
iDEAAM · 2024-07-18 · via 博客园 - iDEAAM

1. 新增一个.ps1文件

# Define the URI
$uri = "http://xxx.com/api/test"

# Invoke the REST method
$response = Invoke-RestMethod -Uri $uri

# Output the response
$response

# Exit the script
exit
  

2. 在windows计划任务新增一个任务
2.1. 配置操作:
在任务向导中,选择“启动程序”作为操作类型,并指定PowerShell可执行文件路径(如C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe),以及您的.ps1脚本文件的路径。2.2. 配置参数:在操作设置中,将您的.ps1脚本文件作为参数传递给PowerShell可执行文件。例如:-File "C:\path\to\your\script.ps1"。

 

-WindowStyle Hidden参数来隐藏PowerShell窗口

powershell.exe -WindowStyle Hidden -File C:\path\to\your\script.ps1

posted @ 2024-07-18 16:47  iDEAAM  阅读(183)  评论(0)    收藏  举报