gpt4 book ai didi

powershell - 无法读取文件内容

转载 作者:行者123 更新时间:2023-12-02 16:03:47 32 4
gpt4 key购买 nike

我正在尝试读取文件的内容:

$releaseNotesPath = "$(System.DefaultWorkingDirectory)\_ccp-develop\ccp\ccp\ReleaseNotes\ReleaseNotes\"
$latestReleaseNotesFile = Get-ChildItem -Path $releaseNotesPath -Filter *.txt | Select-Object FullName,Name | Sort-Object -Property Name | Select-Object -First 1

问题出现在这里:

$releaseNote = Get-Content $latestReleaseNotesFile


2021-11-14T14:29:07.0729088Z ##[error]Cannot find drive. A drive with the name '@{FullName=D' does not exist.
2021-11-14T14:29:07.1945879Z ##[error]PowerShell exited with code '1'.

我做错了什么?

最佳答案

您需要提供文件路径(FullName):

$releaseNote = Get-Content $latestReleaseNotesFile.FullName

关于powershell - 无法读取文件内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69964126/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com