Loading...

Using ChatGPT to generate PowerShell Scripts or get help with Intune


In this post I show you how cool it can be to use ChatGPT to create PowerShell scripts.


What is ChatGPT

ChatGPT is a powerful Chatbot on the web developed by the company OpenAI.

It has been released for public the 30 of November 2022.

It uses IA to do almost whatever you want, of course not coffee :-)

The idea is as a ChatGPT, you have to type your request, click on a button and ChatGPT will the thing for you.

What you can do with it ?

Some things we can do with it:

- Writing a text

- Writing a job interview

- Writing a script (PowerShell, Python...)

- Asking for things about Intune

- Writing a song

- and many more things


Of course you can not do coffee but you can do a lot of things

For instance here below I asked ChatGPT to find me a title for this blog post.


How to connect ?

The first step is to login to ChatGPT.

We will proceed as below:

1. Go to https://chat.openai.com

2. Click on Sign up

3. Click on Create an OpenAI account

4. Choose the way to create your account

5. In my case I used Continue with Google


How does it work ?

ChatGPT is a chat bot, so the idea is that you just need to type your research.

1. After logging the below page is displayed :

2. Go to the text box at the bottom of the page :

3. Type your the thing you need and click on the arrow.


Let's check some examples


Asking for job interview

In the below example I asked: write a interview for an intune job

See below the result:

In the below example I asked: write a interview for a PowerShell job

See below the result:



Asking for Intune/Azure help

In the first example, I want to know how to create a win32 app.

I typed this: how to create a .intunewin file for intune

See below the result:


In the second example, I want to know how to use Azure Automation to add a script and schedule it.

I typed this: how to schedule a powershell script in azure automation

See below the result:


Asking for PowerShell script

Now I will ask ChatGPT to generate some PowerShell scripts.

In the below example I asked: write a powershell script to create a registry key in HKLM

See below the result:


In the below example I asked: write a powershell script to download a file from the web

See below the result:


In the below example I asked: write a powershell script to check accounts in the local administrators group

See below the result:

In the below example I asked: write a powershell script to list devices enrolled in Intune

See below the result:



slider 1336536426350863703

Enregistrer un commentaire

Accueil item

Award

Learn KQL in one month

Sponsors

You want to support me ?

Mes articles en français

Books in French


Stats