all!
I apologise in advance if this has been 开发者_Go百科asked or discussed before; I was not able to find anything from Google.
Here is how I was able to find all variables in a PowerShell script that have a certain scoped option (example here: ReadOnly):
 gv | %{if ( ($_.options -band ([System.Management.Automation.ScopedItemOptions]::ReadOnly).value__)) {echo $_.name}}
There is also the None ScopedItemOption which equals 0. Finding these variables is easy:
 gv | %{if ( $_.options -eq 0) {echo $_.name}}
Does anyone have a better suggestion for doing this?
Thanks!
Carlos Nunez.
Cosmetic version. You can also use the Scope parameter to get variables from other scopes, like Global,Local or Script:
Get-Variable | Where-Object {$_.Options -match 'readonly'} | Select-Object -ExpandProperty Name
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论