,

Powershell: Invoke-Expression

1–2 minutes
1 comment on Powershell: Invoke-Expression

Powershell Header

Using the Invoke-Expression Cmdlet:

The Invoke-Expression cmdlet provides one way to run a script from within Windows PowerShell.

Invoke-Expression c:\scripts\test.ps1

or

& c:\scripts\test.ps1

And you also can run a function in your Powershell Script by a variable. This is something really important when you work with dynamic scripts:

Invoke-Expression -command ($Function_Name)

you even can send dynamic parameters to this function:

Invoke-Expression -command ($Function_Name + ' $Function_Parameters')

One response

  1. farid Avatar

    Hello
    I want to know as you are a Microsoft cloud specialist, if the companies have some interest about Microsoft cloud solution in switzerland.
    thnk you

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.