Equivalent to C#'s “using” keyword in powershell?

前端 未结 9 1935
臣服心动
臣服心动 2020-12-04 14:13

When I use another object in the .net-Framework in C# I can save a lot of typing by using the using directive.

using FooCompany.Bar.Qux.Assembly.With.Ridicul         


        
9条回答
  •  青春惊慌失措
    2020-12-04 15:03

    I realize this is an old post, but I was looking for the same thing and came across this: http://weblogs.asp.net/adweigert/powershell-adding-the-using-statement

    Edit: I suppose I should specify that it allows you to use the familiar syntax of...

    using ($x = $y) { ... }
    

提交回复
热议问题