Code Monkey home page Code Monkey logo

Comments (3)

rohitramu avatar rohitramu commented on May 12, 2024

Is your $graphApiVersion variable set to "beta"? If so, that would explain the difference in properties. The PowerShell SDK is generated against the v1.0 schema. For convenience, there is a cmdlet called Invoke-MSGraphRequest to allow you to craft a custom call:

# Set the schema version to "beta"
Update-MSGraphEnvironment -SchemaVersion 'beta'

# Craft a custom call (the Get-MSGraphAllPages will automatically do paging and unwrap the values in all pages)
$result = Invoke-MSGraphRequest -Url 'deviceManagement/managedDevices?$select=hardwareInformation' | Get-MSGraphAllPages

from intune-powershell-sdk.

POF10 avatar POF10 commented on May 12, 2024

Hi Rohit,

Right, $graphApiVersion is set to 'beta'. After changing SDK schema ver. to 'beta' and calling via custom call everything works fine and I get what I need.

Thanks.

P.S. some additional feedback.
Hardware Information property now exists as well when running like:

(Get-DeviceManagement_ManagedDevices -managedDeviceId eb0872d3-3148-44fb-9b30-ffd66b156362).hardwareinformation


serialNumber                                                   :
totalStorageSpace                                              : 0
freeStorageSpace                                               : 0
imei                                                           :
meid                                                           :
manufacturer                                                   :
model                                                          :
phoneNumber                                                    :
subscriberCarrier                                              :
cellularTechnology                                             :
wifiMac                                                        :
operatingSystemLanguage                                        :
isSupervised                                                   : False
isEncrypted                                                    : False
isSharedDevice                                                 : False
tpmSpecificationVersion                                        :
operatingSystemEdition                                         :
deviceFullQualifiedDomainName                                  :
deviceGuardVirtualizationBasedSecurityHardwareRequirementState : meetHardwareRequirements
deviceGuardVirtualizationBasedSecurityState                    : running
deviceGuardLocalSystemAuthorityCredentialGuardState            : running
sharedDeviceCachedUsers                                        : {}

But it returns nothing (same as via raw HTTP call which is expected) so ?$select=hardwareInformation is used in HTTP call which does the trick. Would be good if 'beta' stuff would be available to Intune PS SDK so it would be possible to do :
Get-DeviceManagement_ManagedDevices -select hardwareInformation
and receive same thing as via custom call\http call.

from intune-powershell-sdk.

rohitramu avatar rohitramu commented on May 12, 2024

Thanks for the feedback Maksim. We are actually not generating the SDK for "beta" exactly for that reason: "beta" should not be used in production code.

from intune-powershell-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.