About 18,000,000 results
Open links in new tab
  1. Set-Variable (Microsoft.PowerShell.Utility) - PowerShell

    The Set-Variable cmdlet assigns a value to a specified variable or changes the current value. If the variable does not exist, the cmdlet creates it.

  2. How to Set Variables in PowerShell?

    Sep 3, 2024 · In PowerShell, you can create a variable by defining a variable name and then setting its value with the Set-Variable command. In this tutorial, I will explain how to set variables in PowerShell using different methods and with examples.

  3. How to use PowerShell Variables - LazyAdmin

    Jan 16, 2024 · In this article, we are going to look at how to assign and use variables and use them in different scopes. Let’s start with the basics of PowerShell variables before we are going to look at all the ins and outs. To create a variable in PowerShell, we will be using the dollar sign $.

  4. about_Variables - PowerShell | Microsoft Learn

    Jan 2, 2025 · To create a new variable, use an assignment statement to assign a value to the variable. You don't have to declare the variable before using it. The default value of all variables is $null. To get a list of all the variables in your PowerShell session, type Get-Variable.

  5. PowerShell: Setting Variables Made Simple

    In this guide, we've explored the fundamentals of PowerShell setting variables, including how to assign, retrieve, and manage variables effectively. By following best practices and understanding the various variable types and scopes, you will be well-equipped to write cleaner, more efficient PowerShell scripts.

  6. In Powershell, how to set variable values within a function and …

    I want to set these values within this function and have those values available later on in the script, in the parent scope. The variables are created in your function's local -scope. Those variables are deleted when your function is done. The scope that is in effect when Windows PowerShell. starts. Variables and functions that are present when.

  7. Set Variables in PowerShell: A Quick Guide - SharePoint Diary

    Apr 5, 2021 · Looking to set PowerShell variables? This guide covers using set-variable cmdlet to assign and manage variables in PowerShell scripts.

  8. Set-Variable Cheat Sheet - Set-Variable Command Line Guide

    Mar 1, 2025 · PowerShell’s Set-Variable cmdlet is a versatile tool for creating or modifying variables in your session. In this detailed guide, we’ll explore what Set-Variable is, why it is important, and how to use it effectively in your scripts.

  9. Variables and Operators - PowerShell - SS64.com

    How-to: Variables and Operators (add, subtract, divide...) In PowerShell, all variable names start with the “$” character. Multiple variables can be initialised in a single line, this will create var1 and var2: $var2= ($var1=1)+1.

  10. How to Use the Set-Variable Command in PowerShell

    Dec 27, 2023 · Creating new variables – You can use Set-Variable to define a new variable by specifying a name and value. Modifying existing variables – Set-Variable allows you to change the value of a variable that already exists in your PowerShell session.

  11. Some results have been removed
Refresh