To help you better we need some information from you.
*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***
Product, version and build:PowerShell Studio 5.8.208
Operating system:Windows 10 ENTERPRISE
PowerShell version(s):7.2.5
using namespace System.Management.Automation
Class SupportedResolution: system.management.automation.IvalidateSetValuesGenerator
{
[string[]] GetValidValues()
{
$Monitors = get-ciminstance -N "root\wmi" -Class WmiMonitorListedSupportedSourceModes
$PossibleModes = new-object -TypeName system.collections.arraylist
foreach ($LoopInMonitors in $Monitors)
{
foreach ($LoopInPossibleResolution in $LoopInMonitors.MonitorSourceModes)
{
$CurrentResolution = "$($LoopInPossibleResolution.HorizontalActivePixels) X $($LoopInPossibleResolution.VerticalActivePixels)"
$PossibleModes.add($CurrentResolution) | out-null
} # END foreach ($LoopInPossibleResolution in $LoopInMonitors.MonitorSourceModes)
} # END foreach ($LoopInMonitors in $Monitors)
return $PossibleModes
}
} # END Class SupportedResolution : system.management.automation.IvalidateSetValuesGenerator
DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
This works in PS 7.2.5 console, also in VScode but PowerShell studio still signal it as error
PowerShell 7 class seems not supported
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
-
- Posts: 2
- Last visit: Sun Mar 17, 2024 11:09 pm
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Re: PowerShell 7 class seems not supported
Can you please clarify what you mean with "still signal it as error"?
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: PowerShell 7 class seems not supported
Please do not post duplicate questions in different forums.
The class System.Management.Automation.IvalidateSetValuesGenerator is only available in PowerShell 7. Please verify that you have PowerShell 7 selected in the ribbon: If this is not the issue, can you please provide a screenshot of the application with the file open?
The class System.Management.Automation.IvalidateSetValuesGenerator is only available in PowerShell 7. Please verify that you have PowerShell 7 selected in the ribbon: If this is not the issue, can you please provide a screenshot of the application with the file open?
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
-
- Posts: 2
- Last visit: Sun Mar 17, 2024 11:09 pm
Re: PowerShell 7 class seems not supported
Picture attached.
I am really in V7 as you'll see in the picture.
So the powershell version is not the issue.
I am really in V7 as you'll see in the picture.
So the powershell version is not the issue.
- Attachments
-
- ErreurClass.png (429.35 KiB) Viewed 1552 times
Re: PowerShell 7 class seems not supported
Interesting. I have not been able to reproduce that behavior.
Does the script report an error if you attempt to run it?
Does the error go away if you format the script from the ribbon (Home->Edit):
Does the script report an error if you attempt to run it?
Does the error go away if you format the script from the ribbon (Home->Edit):
Brittney
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.