# Your First Script

A script is an application: write one, run it, and start it from anywhere, even a double-click.

Updated: November 10, 2026

## [Scripts](https://www.ask-codey.com/courses/powershell-in-depth/topics/powershell-scripts)

1. [A Script Is an Application](https://www.ask-codey.com/lessons/powershell-scripts-are-applications) (Novice): Every application takes something in, does some work and gives something back, and a PowerShell script does the same from a .ps1 text file you can read, which makes it a quick-run application of your own, best at jobs made of files, data, settings and other programs.
2. [Writing Scripts in VS Code](https://www.ask-codey.com/lessons/powershell-scripts-in-vs-code) (Apprentice): VS Code with Microsoft's free PowerShell extension colors a script, suggests commands as you type, underlines problems such as a missing quote or an alias before you run anything, and runs the whole script with F5 in a terminal inside the editor.
3. [Your First Script](https://www.ask-codey.com/lessons/powershell-your-first-script) (Apprentice): A script is a .ps1 file of commands that run from top to bottom, with comments starting with # that say what it does, and you run it from its own folder with .\\ and its name, because PowerShell never looks in the current folder for a command on its own.
4. [Run It from Anywhere](https://www.ask-codey.com/lessons/powershell-run-from-anywhere) (Apprentice): A script that reads its files from $PSScriptRoot works from any folder; a Scripts folder on your PATH lets you run it by name, pwsh -File starts it from outside PowerShell, and a desktop shortcut with pwsh -File in its target runs it with a double-click.

## [Exercise: A Morning Start-Up Script](https://www.ask-codey.com/courses/powershell-in-depth/topics/exercise-powershell-a-morning-start-up-script)

1. [Exercise: A Morning Start-Up Script](https://www.ask-codey.com/lessons/exercise-powershell-a-morning-start-up-script) (Apprentice): Write morning.ps1, a script that greets whoever runs it, shows the date, reads the to-do list beside it from any folder and shows the free space on drive C, answer three questions about running it, and let a Pester check run it the way someone else would.

Source: https://www.ask-codey.com/courses/powershell-in-depth/chapters/powershell-your-first-script
