microsoftgraph / powershell-intune-samples

This repository of PowerShell sample scripts show how to access Intune service resources. They demonstrate this by making HTTPS RESTful API requests to the Microsoft Graph API from PowerShell.
MIT License
1.36k stars 657 forks source link

Issue / Help using script params #257

Open jshplayer opened 1 year ago

jshplayer commented 1 year ago

Hi, i'm trying to pass simple functions through to these scripts including the tenant admin UPN (so it doesn't ask) and the JSON directory output (again so it doesn't ask). This is to automate the scripting process however I can't seem to get these scripts to accept the passed params?

They seem to have a param configured for use from what i can see? (for $user and $json)

What i'm pushing to the .ps1 via a batch: powershell.exe -command 'powershell-intune-samples-master\CompliancePolicy\CompliancePolicy_Import_FromJSON.ps1' -User 'user@domain.com' -JSON 'dirname'

Any help is much appreciated.