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

推荐订阅源

U
Unit 42
罗磊的独立博客
T
Tailwind CSS Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
V
V2EX
美团技术团队
阮一峰的网络日志
阮一峰的网络日志
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
量子位
MyScale Blog
MyScale Blog
G
Google Developers Blog
M
MIT News - Artificial intelligence
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
B
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)    收藏  举报