Forum Discussion
Powershell not recognizing cmdlet?
I'm launching Powershell ISE and attempting to use get-azureadmconditionalaccesspolicy. This is from a shared server. Another user is able to run the same script without issue. I get the following response.
get-azureadmconditionalaccesspolicy : The term 'get-azureadmconditionalaccesspolicy' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ get-azureadmconditionalaccesspolicy
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-azureadmconditionalaccesspolicy:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
In Powershell ISE, I'm able to select the AzureADPreview module and locate the command. When I run Get-installedmodule, I'm able to see the following entries.
2.0.2.140 AzureAD PSGallery Azure Active Directory V2 General Availability Module....
2.0.2.138 AzureADPreview PSGallery Azure Active Directory V2 Preview Module. ...
the command should be available, so I'm unsure what I'm missing.
OK, that suggests that the values are text values.
With such a value in A2, enter the following formula in the cell next to it:
=LET(v,A2,p,FIND(" ",v),d,LEFT(v,p-1),s_1,FIND("/",d),s_2,FIND("/",d,s_1+1),t,MID(v,p+1,15),DATE(RIGHT(d,4),LEFT(d,s_1-1),MID(d,s_1+1,s_2-s_1-1))+TIMEVALUE(t))
Fill down.
Or use Power Query (Get and Transform).
2 Replies
- The cmdlet is Get-AzureADMSConditionalAccessPolicy, make sure you type (paste) it correctly as your example is missing an "S".
- JamesA1675Copper ContributorI was having a hell of a day yesterday. I ran into the error, installed the module, but still couldn't run it. In my troubleshooting I went to manually typing in the command and ended up misspelling it. I checked today and the script is working for me. Thank you for pointing out the misspelling. Would have drove me crazy today again.