But, I can't seem to get it to return the volumes that do not have any SIS settings at all. I've tried each of the following with the assumption that the property doesn't exist for any volumes that do not have SIS enabled:
Interesting - I tried many systems (9.3, 9.5, and 9.6) and multiple versions of the PSTK (as far back as 3.2 and 9.5, 9.6, and 9.7 as well) and was not able to find an instance where the "State" property did not contain a value on any of my volumes - if efficiency was enabled, the property was "enabled" and if disabled showed "disabled".
"Get-NcSis" without any additional parameters should show you the efficiency settings on all of your volumes without needing to store the output of the "Get-NcVol" cmdlet in a variable as in your example (with the one caveat of displaying the path rather than just the volume name, I suppose).
When you run "Get-NcSis", do you still get properties with null values in your output?
If you install a more recent version of the PSTK, are you able to replicate the issue?
Thanks, @JGPSHNTAP , that definitely seems to do the trick. Sorry, should have looked at your response before responding.
That line of code does return a correct list of all the volumes and their sis status, I'm not clear on what exactly the code is doing. If I look at that property of the object, it shows me either true or false. Is your "If" statement just saying that if it's true return "enabled", otherwise return "disabled"?
It returns all the volumes where SIS is disabled. It reacts the same if I have true or false after the operator, so it seems to only care about what the operator is, not what is following it. That makes no sense to me. My PS-Fu is weak. 🙂
@donny_lang, this happens for volumes that do not have SIS enabled, so I want to identify these volumes as well. From the CLI, you can find these volumes using this command:
vol show -volume !*root*,!vol0 -is-sis-volume false
So, I think I may have partially answered my own question. I think I actually need to run a different command to look for volumes that do not have SIS enabled. For PowerShell, it seems like this parameter is what I want to look for:
I would think that this would work, but it doesn't. Why?