如何在 GitLab 管道中运行 PowerShell 脚本?

时间:2021-04-22 10:50:16

标签: powershell gitlab gitlab-ci pipeline

我正在 Windows VM 上运行管道作业,默认执行程序为 shell。在这项工作中,我希望通过以下几行运行一个位于名为 CICD 的目录中的 powershell 脚本:

- powershell .\CICD\build_script.ps1 x86 $PROJECT_PATH
- .\CICD\build_script.ps1 x86 $PROJECT_PATH
- '.\CICD\build_script.ps1 x86 $PROJECT_PATH'

该脚本有 2 个参数:x86 和 $PROJECT_PATH。 每次我尝试运行这些命令之一时,我都会收到此错误:

.\CICD\build_script.ps1 : The term '.\CICD\build_script.ps1' is not recognized as the name of a cmdlet, function, 
script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is 
correct and try again.
At line:1 char:1
+ .\CICD\build_script.ps1 x86 C:\GitLab-Runner\builds\BRmNra1o\0\mihnea ...
+ ~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.\CICD\build_script.ps1:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

有没有合适的方法来运行这个脚本?

1 个答案:

答案 0 :(得分:0)

您需要一个 df1 = pd.DataFrame({ "key1": ['K', 'K', 'A1', 'A2', 'B1', 'B9', 'C3'], "key2": ['a5', 'a4', 'a7', 'a9', 'b2', 'b8', 'c1'], "Value1": ['apple', 'guava', 'kiwi', 'grape', 'banana', 'peach', 'berry'], }) df2 = pd.DataFrame({ "key1": ['K', 'A1', 'A3', 'B1', 'C2', 'C3'], "key2": ['a9', 'a7', 'a9', 'b2', 'c7', 'c1'], "Value2": ['apple', 'kiwi', 'grape', 'banana', 'guava', 'orange'], }) merged_df = pd.merge(df1, df2, how="outer", on=['key1', 'key2']) 而不是 /

\
相关问题