需要一点帮助来取消gridview时,点击取消,如果可能的话,打开一个较小的窗口(有很多空白的空间),此外,有时字符串是打开...并需要采取光标的权利,看到全名。
脚本从CSV中读取数据并相应地初始化变量
$Versions = Get-Content "$SharedDriveFolderPath\Versions\dataSource.csv"
$Versions = $Versions | ConvertFrom-CSV -Del ";"
do { $VersionToUse = $Versions.Sheetcol | Out-Gridview -Title "Choose version from the list" -PassThru } while ($Versions.Sheetcol -notcontains $VersionToUse)
$Versionlocationforpatches = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).Versionlocationforpatches
$Versionlocationforcabs = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).Versionlocationforcabs
$ReleaseVersion = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).ReleaseVersion
$Sourceversion = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).Sourceversion
$LinkForVersion = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).LinkForVersion
$VersionNumber = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).VersionNumber
$buildver = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).buildver
$PipelineID = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).PipelineID
$xmlFilePath = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).xmlFilePath
$Buildname = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).Buildname
$Sheetcol = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).Sheetcol
$QApath = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).QApath
$Weekendversion = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).Weekendversion
$BlockUpload = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).BlockUpload
$PrepareCI = ($Versions | Where-Object { $_.Sheetcol -eq $VersionToUse }).PrepareCI
这是一个输出窗口:
下面是csv的样子:窗口中的每一行代表csv中的一行。
ReleaseVersion;Sourceversion;Versionlocationforpatches;Versionlocationforcabs;LinkForVersion;VersionNumber;buildver;PipelineID;xmlFilePath;Buildname;Sheetcol;QApath;Weekendversion;BlockUpload;PrepareCI
8.5.34.31.6;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.5.34.31;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.5.34.31\Installer\Patches;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.5.34.31\Installer;\\global\builds\Releases\RingOne Builds\8.5 RingOne\8.5.34.31.6;8.5.34.31;8.5.34.31;18710;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.5.34.31\BuildDescription.xml;8.5.34.31.5;8.5.34 Side VIP CU4;\\global\QA\AgileTeam\Ziv\Builds\8.5.34.31-CU4;;;
8.5.34.35.6;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.5.34.35;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.5.34.35\Installer\Patches;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.5.34.35\Installer;\\global\builds\Releases\RingOne Builds\8.5 RingOne\8.5.34.35.6;8.5.34.35_Federal;8.5.34.35;18713;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.5.34.35\BuildDescription.xml;Side VIP for 8.5.34.35_Federal;8.5.34.35 Side VIP Federal;\\global\QA\AgileTeam\Ziv\Builds\8.5.34.35_GA_Federal;;;
8.6.22.607.40;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.22.607;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.22.607\Installer\Patches;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.22.607\Installer;\\global\builds\Releases\RingOne Builds\8.6 RingOne\8.6.22.607.40;8.6.22.607;8.6.22.607;26845;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.22.607\BuildDescription.xml;Side VIP for 8.6.22.607;8.6.22 Side VIP + CU6;\\global\QA\AgileTeam\Ziv\Builds\8.6.22.607;8.6.22.607.32;BlockUpload.txt;22212
8.6.22.2000.38;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.22.2000;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.22.2000\Installer\Patches;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.22.2000\Installer;\\global\builds\Releases\RingOne Builds\8.6 RingOne\8.6.22.2000.38;8.6.22.2000_Federal;8.6.22.2000;27970;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.22.2000\BuildDescription.xml;Side VIP for 8.6.22.2000_Federal;8.6.22 Side VIP Federal;\\global\QA\AgileTeam\Ziv\Builds\8.6.22.2000_Federal;;BlockUpload_Federal.txt;22212
8.6.32.236.4;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.32.236;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.32.236\Installer\Patches;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.32.236\Installer;\\global\builds\Releases\RingOne Builds\8.6 RingOne\8.6.32.236.4;8.6.32.236;8.6.32.236;26845;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.32.236\BuildDescription.xml;Side VIP for 8.6.32.236;8.6.32 Side VIP;\\global\QA\AgileTeam\Ziv\Builds\8.6.32.236;8.6.32.236.1;BlockUpload.txt;22212
8.6.32.2002.5;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.32.2002;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.32.2002\Installer\Patches;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.32.2002\Installer;\\global\builds\Releases\RingOne Builds\8.6 RingOne\8.6.32.2002.5;8.6.32.2002;8.6.32.2002;27970;\\global\Engineering\Builds\Agile\SideVIP\Versions\8.6.32.2002\BuildDescription.xml;Side VIP for 8.6.32.2002;8.6.32 Side VIP Federal;\\global\QA\AgileTeam\Ziv\Builds\8.6.32.2002;8.6.32.2002.1;BlockUpload_Federal.txt;22212
1条答案
按热度按时间ugmeyewa1#
如果你把csv作为一个对象导入并使用表单,你可以给予自己更多的灵活性: