【发布时间】:2021-12-08 04:23:00
【问题描述】:
我刚开始使用 Powershell,已经遇到了问题。 我正在使用 OpenWeathermap (https://openweathermap.org/) 的 API 来创建类似天气机器人的东西。
我正在使用 API 中的这个函数:
Write-WeatherCurrent -City $place -ApiKey $ApiKey -Units metric
输出是这样的(如果我填写变量): 伦敦 10.2°C(☁️ 几朵云)
所以我希望这个输出保存在一个文件中。我已经尝试过使用 Commands Out-File 和 >>。但它只在终端输出,文件为空。我不确定,但是否因为“Write”-WeatherCurrent?
如果有人可以帮助我,我会很高兴:D
谢谢
【问题讨论】:
标签: powershell api openweathermap