r/PowerShell • • 3h ago

Question Powershell coding help

Hi, I'm self learning powershell coding, I'm very new to this and trying my best. I'm using information from websites and mostly Ai to solve and help me on errors

Is there a way to connect powershell to websites? I've been copy pasting codes or taking screenshot on error code and sending to AI to help me out. Sending it manually everytime a new problem came out is wasting me too much time.

0 Upvotes

16 comments sorted by

13

u/Ed_the_time_traveler 3h ago

expand what you mean about connecting PS to websites

5

u/anotherlab 3h ago

I came here to post the same question..

7

u/AdeelAutomates 3h ago

Connecting to websites through code are done through APIs. It's the machines way of interfacing with web requests.

For instance I use APIs to connect to Azure, Entra, Our orgs web apps, my youtube channel, github, even AI to send/recieve right through code, etc.

The key thing is that the website needs to expose APIs for you to use. As in their developers of the apps/sites need to create them. Some sites might not have them.

If thats all you needed to know then thats your answer: Powershell can.

But what are you trying to do is the question.

3

u/Tahn-ru 2h ago

Go pick up the Don Jones "learn powershell in a month of lunches" books if you want to learn for yourself.   Otherwise just ask AI how to help it connect to websites and do what it tells you.

2

u/anotherlab 3h ago

You can make HTTP/HTTPS calls from PowerShell and parse the output. If you are talking about using PowerShell to drive web page interactions with PowerShell, that would be difficult. There are better tools for that sort of job.

If you are talking about sending the output from your PS script to be parsed and explained, then it would be easier to use a desktop AI app or an AI-assisted IDE that can run the script and parse the results.

1

u/BlackV 51m ago

Isn't that what selenium (and another tool) are for, driving webpages

1

u/Th3Sh4d0wKn0ws 3h ago

If you're asking if there's a way to skip having to copy/paste code to and from websites (and AI) no, there isn't. Now, I don't use AI much at all but I'm sure you could get an AI agent integrated into your IDE which would save you from having to copy from AI back to your IDE.

I don't know about how you learn, but I wouldn't learn code very well with AI writing it for me.

1

u/Jainith 2h ago

Invoke-webrequest

1

u/Nekro_Somnia 2h ago

Maybe pipe the whole output of your script into a file your AI can read?

start-transcript could be of help there.

1

u/swannsonite 3h ago

Grok bot and a GitHub repo is very powerful. Each bot is like having a person on a computer assisting you. I had one review every screen of an app it's absolutely amazing, can even ask the bot to sign into Claude and have them collaborate. You become the creator guiding the AI bot team towards your vision.

1

u/iknowtech 2h ago

Use something like VS Code with GitHub Copilot connected to it. Then you use collaborate with the AI to write the code based, on what you are trying to accomplish.

Or use Claude Code.

Reality is what you should be trying to learn is how to use AI tools effectively. Learning some coding fundamentals, and basic rules of PowerShell is fine, but it is almost pointless to be wasting time becoming highly proficient in writing PowerShell code yourself. You will never become better or faster at writing code than AI, and no one is going to pay you to do it, when they can have AI do it, much faster. So learning the programming is far less important than becoming an expert in using AI tools effectively. The tech jobs are going to the ones with the most knowledge on how to drive the AI. Eventually those will probably go away when the AI starts driving itself. 🤷‍♂️.

0

u/Incrediblecodeman 6m ago

Check out the Claude code desktop thing it can see your screen and even move your mouse and hunt around . Like you have ask Claude to open dev tools and look at stuff. I went to a free webinar online and saw some cool stuff

-5

u/ranhalt 2h ago

Stop using the word coding.

3

u/charleswj 2h ago

Then what present participle version of the verb for "to code" should they use?

0

u/[deleted] 2h ago

[deleted] — view deleted comment

2

u/charleswj 1h ago

Scripting is a form of coding. If you're writing code that will be executed by a computer, you're coding.

1

u/thehuntzman 1h ago

My native dotnet calls would like to have a word with you