Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Does anyone know when to you use '+' or '.' when accessing enum values (or other class members perhaps)?

$
0
0

Example:

To get the documents and settings folder from powershell, you do something like:

[System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::MyDocuments)

SpecialFolder is a .NET enumerator, but it can't be accessed by [System.Environment.SpecialFolder]::MyDocuments syntax...

On other hand - a member of the SearchOption (System.IO namespace) enumerator is accessed by:

[System.IO.SearchOption]::AllDirectories

Does anyone know what is the difference?


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>