Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile MOF fails with an error "Missing Argument in parameter list" #1871

Closed
gitmanphilly opened this issue Apr 7, 2022 · 12 comments · Fixed by #2341, #2371 or #2380
Closed

Compile MOF fails with an error "Missing Argument in parameter list" #1871

gitmanphilly opened this issue Apr 7, 2022 · 12 comments · Fixed by #2341, #2371 or #2380
Labels
Bug Something isn't working Intune

Comments

@gitmanphilly
Copy link

No description provided.

@malauter
Copy link
Member

malauter commented Apr 8, 2022

Can you please provide more information about the configuration you try to compile and the used M365 DSC version?

@gitmanphilly
Copy link
Author

Well that's interesting - where's my original message? I provided all the info. The version was the last 3 versions of DSC. Updated each time to see if that would correct the issue. Config export was Intune. Error is missing argument at [System.String, that last comma shows a tilde under it meaning it doesn't like it. ParseException error is thrown.

@andikrueger
Copy link
Collaborator

@gitmanphilly any chance you could update the module using this approach:

Update-Module Microsoft365DSC
Update-M365DSCDependencies
Uninstall-M365DSCOutdatedDependencies

This will remove old dependencies as well as older versions of M365.

@andikrueger
Copy link
Collaborator

Closing due to inactivity. Please reopen this issue, if it still exists.

@peteramza
Copy link

I am getting this same error. Can this be re-opened. I have tried your last suggestion and still get the Missing argument in parameter list. I am specifically trying to compile a mof from an Intune/MEM export.

@andikrueger andikrueger reopened this Aug 12, 2022
@andikrueger
Copy link
Collaborator

Could you share your configuration so that we get a chance to reproduce? Please remove sensitive information.

@peteramza
Copy link

Generated with Microsoft365DSC version 1.22.720.1

For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC

param (
[parameter()]
[System.Management.Automation.PSCredential]
$Credential
)

Configuration M365TenantConfig
{
param (
[parameter()]
[System.Management.Automation.PSCredential]
$Credential
)

if ($null -eq $Credential)
{
    <# Credentials #>
    $Credscredential = Get-Credential -Message "Credentials"

}
else
{
    $CredsCredential = $Credential
}

$OrganizationName = $CredsCredential.UserName.Split('@')[1]
Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.22.720.1'

Node localhost
{
    IntuneDeviceConfigurationPolicyiOS 1e95db95-6532-4489-8f94-313d975704c8
    {
        AccountBlockModification                       = $True;
        ActivationLockAllowWhenSupervised              = $True;
        AirDropBlocked                                 = $False;
        AirDropForceUnmanagedDropTarget                = $True;
        AirPlayForcePairingPasswordForOutgoingRequests = $True;
        AppleNewsBlocked                               = $False;
        AppleWatchBlockPairing                         = $False;
        AppleWatchForceWristDetection                  = $True;
        AppStoreBlockAutomaticDownloads                = $True;
        AppStoreBlocked                                = $True;
        AppStoreBlockInAppPurchases                    = $True;
        AppStoreBlockUIAppInstallation                 = $True;
        AppStoreRequirePassword                        = $False;
        AppsVisibilityList                             = @();
        AppsVisibilityListType                         = "none";
        BluetoothBlockModification                     = $False;
        CameraBlocked                                  = $False;
        CellularBlockDataRoaming                       = $False;
        CellularBlockGlobalBackgroundFetchWhileRoaming = $False;
        CellularBlockPerAppDataModification            = $False;
        CellularBlockVoiceRoaming                      = $False;
        CertificatesBlockUntrustedTlsCertificates      = $True;
        ClassroomAppBlockRemoteScreenObservation       = $False;
        CompliantAppListType                           = "none";
        CompliantAppsList                              = @();
        ConfigurationProfileBlockChanges               = $True;
        Credential                                     = $Credscredential;
        DefinitionLookupBlocked                        = $False;
        DeviceBlockEnableRestrictions                  = $False;
        DeviceBlockEraseContentAndSettings             = $True;
        DeviceBlockNameModification                    = $True;
        DiagnosticDataBlockSubmission                  = $True;
        DiagnosticDataBlockSubmissionModification      = $False;
        DisplayName                                    = "iOS Device Restrictions";
        DocumentsBlockManagedDocumentsInUnmanagedApps  = $True;
        DocumentsBlockUnmanagedDocumentsInManagedApps  = $False;
        EmailInDomainSuffixes                          = @();
        Ensure                                         = "Present";
        EnterpriseAppBlockTrust                        = $True;
        EnterpriseAppBlockTrustModification            = $False;
        FaceTimeBlocked                                = $True;
        FindMyFriendsBlocked                           = $False;
        GameCenterBlocked                              = $True;
        GamingBlockGameCenterFriends                   = $True;
        GamingBlockMultiplayer                         = $True;
        HostPairingBlocked                             = $True;
        iBooksStoreBlocked                             = $False;
        iBooksStoreBlockErotica                        = $True;
        iCloudBlockActivityContinuation                = $True;
        iCloudBlockBackup                              = $False;
        iCloudBlockDocumentSync                        = $True;
        iCloudBlockManagedAppsSync                     = $True;
        iCloudBlockPhotoLibrary                        = $False;
        iCloudBlockPhotoStreamSync                     = $False;
        iCloudBlockSharedPhotoStream                   = $False;
        iCloudRequireEncryptedBackup                   = $True;
        iTunesBlockExplicitContent                     = $True;
        iTunesBlockMusicService                        = $False;
        iTunesBlockRadio                               = $False;
        KeyboardBlockAutoCorrect                       = $False;
        KeyboardBlockPredictive                        = $False;
        KeyboardBlockShortcuts                         = $False;
        KeyboardBlockSpellCheck                        = $False;
        KioskModeAllowAssistiveSpeak                   = $False;
        KioskModeAllowAssistiveTouchSettings           = $False;
        KioskModeAllowAutoLock                         = $False;
        KioskModeAllowColorInversionSettings           = $False;
        KioskModeAllowRingerSwitch                     = $False;
        KioskModeAllowScreenRotation                   = $False;
        KioskModeAllowSleepButton                      = $False;
        KioskModeAllowTouchscreen                      = $False;
        KioskModeAllowVoiceOverSettings                = $False;
        KioskModeAllowVolumeButtons                    = $False;
        KioskModeAllowZoomSettings                     = $False;
        KioskModeRequireAssistiveTouch                 = $False;
        KioskModeRequireColorInversion                 = $False;
        KioskModeRequireMonoAudio                      = $False;
        KioskModeRequireVoiceOver                      = $False;
        KioskModeRequireZoom                           = $False;
        LockScreenBlockControlCenter                   = $False;
        LockScreenBlockNotificationView                = $False;
        LockScreenBlockPassbook                        = $False;
        LockScreenBlockTodayView                       = $False;
        MediaContentRatingApps                         = "allBlocked";
        MediaContentRatingUnitedStates                 = System.Collections.Generic.Dictionary`2[System.String,System.Object];
        MessagesBlocked                                = $False;
        NotificationsBlockSettingsModification         = $False;
        PasscodeBlockFingerprintUnlock                 = $False;
        PasscodeBlockModification                      = $False;
        PasscodeBlockSimple                            = $True;
        PasscodeMinimumLength                          = 6;
        PasscodeMinutesOfInactivityBeforeLock          = 0;
        PasscodeMinutesOfInactivityBeforeScreenTimeout = 5;
        PasscodePreviousPasscodeBlockCount             = 12;
        PasscodeRequired                               = $True;
        PasscodeRequiredType                           = "numeric";
        PasscodeSignInFailureCountBeforeWipe           = 4;
        PodcastsBlocked                                = $False;
        SafariBlockAutofill                            = $False;
        SafariBlocked                                  = $True;
        SafariBlockJavaScript                          = $True;
        SafariBlockPopups                              = $True;
        SafariCookieSettings                           = "allowCurrentWebSite";
        SafariManagedDomains                           = @();
        SafariPasswordAutoFillDomains                  = @();
        SafariRequireFraudWarning                      = $True;
        ScreenCaptureBlocked                           = $True;
        SiriBlocked                                    = $False;
        SiriBlockedWhenLocked                          = $True;
        SiriBlockUserGeneratedContent                  = $False;
        SiriRequireProfanityFilter                     = $True;
        SpotlightBlockInternetResults                  = $False;
        VoiceDialingBlocked                            = $False;
        WallpaperBlockModification                     = $True;
    }
}

}
M365TenantConfig -ConfigurationData .\ConfigurationData.psd1 -Credential $Credential

@andikrueger andikrueger added Bug Something isn't working Intune and removed Pending Information labels Aug 12, 2022
@andikrueger
Copy link
Collaborator

Just a bit of additional information about the actual type of this property: https://docs.microsoft.com/de-de/graph/api/resources/intune-deviceconfig-mediacontentratingunitedstates?view=graph-rest-1.0

{
  "@odata.type": "#microsoft.graph.mediaContentRatingUnitedStates",
  "movieRating": "String",
  "tvRating": "String"
}

@peteramza
Copy link

So is the M365DSC exporting this incorrectly?

@andikrueger
Copy link
Collaborator

Yes. The handling of the values of this parameter needs to be adjusted to the underlying Microsoft graph data type.

@peteramza
Copy link

So still trying to figure this out. So there is no simple way to export and import configurations as DSC shows in the site when using certain exports, such as MEM/Intune? If you are exporting certain parts of MEM configurations, such as the content region, then it will always error out until the .ps1 is edited correctly? I found that there are 4 different parameters throwing the same error so far. Just seeing if I am missing something or if this is indeed the case, because if so then I may rethink how I go about exporting Intune configs.

@William-Francillette
Copy link
Contributor

@andikrueger @NikCharlebois

Just regenerated the resource with the DRG and it should resolve this issue as it supports embedded classes
It would also add the assignments, descriptions and unit test

There's other Intune resources which needs attention as generated with the first version of the DRG (I presume) - They would have the same sort of issue as what is reported here and #2195

I'll probably wait until the other PRs are approved before posting that one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment