Use HTML form as GUI for powershell

后端 未结 7 1128
北海茫月
北海茫月 2021-02-10 03:57

I have a powershell script that I would like to run using an html form. All I have is a few form fields and a button. When I run my powershell script, it opens a new ie window

7条回答
  •  你的背包
    2021-02-10 04:28

    Because you are already able to open a new ie window from your powershell script and navigate to the correct page, I'm assuming that you are using InternetExplorer Object. That's why I'm thinking @ravikanth link is good for you. From there (and from many other posts on the internet) you can see how to grab value fields using $ie.Document.getElementById("fieldid").value, do you?

    Another option is System.Net.WebClient which is the proper way to GET/POST web page data. You have a nice example here.

    Otherwise, I think you should be more clear about what you want to do and provide some code sample of what you are trying to do.

提交回复
热议问题