0
0
PowerShellscripting~10 mins

PowerShell console and ISE - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - PowerShell console and ISE
Start PowerShell Console
Type Command
Press Enter
Command Executes
Output Displayed
Repeat or Exit
Start PowerShell ISE
Write Script in Editor
Run Script or Commands
Output in Console Pane
Edit and Debug
Save Script or Exit
PowerShell console lets you type and run commands one by one. PowerShell ISE lets you write, run, and debug scripts with an editor and console together.
Execution Sample
PowerShell
Write-Host "Hello, PowerShell!"
$sum = 5 + 3
Write-Host "Sum is $sum"
This script prints a greeting, calculates a sum, and prints the result.
Execution Table
StepActionCommand/ExpressionOutputNotes
1Print greetingWrite-Host "Hello, PowerShell!"Hello, PowerShell!Outputs text to console
2Calculate sum$sum = 5 + 3Stores 8 in variable $sum
3Print sumWrite-Host "Sum is $sum"Sum is 8Outputs sum value
4EndScript finished running
💡 All commands executed sequentially, script ends after last command
Variable Tracker
VariableStartAfter Step 2Final
$sumundefined88
Key Moments - 3 Insights
Why does Write-Host show output immediately in the console?
Write-Host sends output directly to the console pane, so you see the text right away as shown in execution_table step 1 and 3.
What is the difference between running commands in console vs ISE?
Console runs commands one by one immediately, while ISE lets you write multiple lines in the editor and run them together, as shown in the concept_flow.
Why do variables keep their values after assignment?
Variables like $sum store values in memory during the session, so after step 2 in execution_table, $sum holds 8 until changed or session ends.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the output after step 1?
AHello, PowerShell!
BSum is 8
C8
DNo output
💡 Hint
Check the Output column in execution_table row for step 1
At which step is the variable $sum assigned a value?
AStep 1
BStep 2
CStep 3
DStep 4
💡 Hint
Look at the Action and Command columns in execution_table to find where $sum is set
If you run the script in PowerShell console instead of ISE, what changes?
AOutput appears immediately after each command
BYou cannot assign variables
CScript cannot run
DNo output is shown
💡 Hint
Refer to concept_flow differences between console and ISE
Concept Snapshot
PowerShell console runs commands one by one, showing output immediately.
PowerShell ISE provides an editor to write, run, and debug scripts.
Use Write-Host to print messages.
Variables store values during the session.
ISE helps edit and test scripts before running.
Console is quick for single commands.
Full Transcript
PowerShell console lets you type commands and see results right away. You start it, type a command like Write-Host "Hello, PowerShell!", press Enter, and see the output immediately. Variables like $sum can store values, for example $sum = 5 + 3 stores 8. Then you can print it with Write-Host "Sum is $sum". PowerShell ISE is different because it has an editor where you write multiple lines of script, run them together, and see output in a console pane below. This helps you write and debug scripts easily. The console is good for quick commands, while ISE is better for scripts. Variables keep their values during the session until changed or closed. Write-Host prints text directly to the console. Running the same script in console or ISE produces the same output, but ISE gives you more tools to edit and test your code.