windows中powershell的curl wget——Invoke-WebRequest

windows的curl和wget是假的,实际上是Invoke-WebRequest.exe。
以下是脚本是使用Invoke-WebRequest上传文件到jfrog:

$filePath = ".\file.zip"

$targetFilePath = "file.zip"

$url = "http(s)://<ARTIFACTORY_URL>/<REPO>/<PATH>/$targetFilePath"

$authorization = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("<username>:<token>"))

$headers = @{

"Authorization" = "Basic $authorization"

}

Invoke-WebRequest -Uri $url -Headers $headers -Method PUT -InFile $filePath
posted @   YueQAQ  阅读(169)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下
点击右上角即可分享
微信分享提示