diff --git a/PlannerModule/PlannerModule.psd1 b/PlannerModule/PlannerModule.psd1 new file mode 100644 index 0000000..80cd9a1 --- /dev/null +++ b/PlannerModule/PlannerModule.psd1 @@ -0,0 +1,159 @@ +<# + =========================================================================== + Created on: 6/3/2019 1:55 AM + Created by: Zeng Yinghua + Organization: + Filename: PlannerModule.psd1 + ------------------------------------------------------------------------- + Module Manifest + ------------------------------------------------------------------------- + Module Name: PlannerModule + =========================================================================== +#> + + +@{ + + # Script module or binary module file associated with this manifest + RootModule = 'PlannerModule.psm1' + + # Version number of this module. + ModuleVersion = '1.0.1.7' + + # ID used to uniquely identify this module + GUID = 'f9dfe908-e078-42d3-9276-1bd1de619e58' + + # Author of this module + Author = 'Zeng Yinghua' + + # Company or vendor of this module + CompanyName = '' + + # Copyright statement for this module + Copyright = '(c) 2019. All rights reserved.' + + # Description of the functionality provided by this module + Description = 'PowerShell Module for Microsoft Planner' + + # Minimum version of the Windows PowerShell engine required by this module + PowerShellVersion = '5.0' + + # Name of the Windows PowerShell host required by this module + PowerShellHostName = '' + + # Minimum version of the Windows PowerShell host required by this module + PowerShellHostVersion = '' + + # Minimum version of the .NET Framework required by this module + DotNetFrameworkVersion = '2.0' + + # Minimum version of the common language runtime (CLR) required by this module + CLRVersion = '2.0.50727' + + # Processor architecture (None, X86, Amd64, IA64) required by this module + ProcessorArchitecture = 'None' + + # Modules that must be imported into the global environment prior to importing + # this module + RequiredModules = @() + + # Assemblies that must be loaded prior to importing this module + RequiredAssemblies = @() + + # Script files (.ps1) that are run in the caller's environment prior to + # importing this module + ScriptsToProcess = @() + + # Type files (.ps1xml) to be loaded when importing this module + TypesToProcess = @() + + # Format files (.ps1xml) to be loaded when importing this module + FormatsToProcess = @() + + # Modules to import as nested modules of the module specified in + # ModuleToProcess + NestedModules = @() + + # Functions to export from this module + FunctionsToExport = @( + 'Get-PlannerAuthToken', + 'Update-PlannerModuelEnvironment', + 'Invoke-ListUnifiedGroups', + 'New-AADUnifiedGroup', + 'Add-AADUnifiedGroupMember', + 'Get-PlannerPlanGroup', + 'Invoke-ListPlannerPlans', + 'Get-PlannerPlan', + 'Invoke-ListPlannerPlanTasks', + 'Invoke-ListPlannerPlanBuckets', + 'Get-PlannerTask', + 'Get-PlannerTaskDetails', + 'Get-PlannerPlanDetails', + 'Get-PlannerBucket', + 'Invoke-ListPlannerBucketTasks', + 'Get-PlannerAssignedToTaskBoardTaskFormat', + 'Get-PlannerBucketTaskBoardTaskFormat', + 'Get-PlannerProgressTaskBoardTaskFormat', + 'New-PlannerPlan', + 'New-PlannerPlanToGroup', + 'New-PlannerBucket', + 'New-PlannerTask', + 'Get-AADUser', + 'Invoke-AssignPlannerTask', + 'Update-PlannerPlanCategories', + 'Invoke-AssignPlannerTaskCategories', + 'Add-PlannerTaskDescription', + 'Add-PlannerTaskChecklist', + 'Connect-Planner' + ) #For performance, list functions explicitly + + # Cmdlets to export from this module + CmdletsToExport = '*' + + # Variables to export from this module + VariablesToExport = '*' + + # Aliases to export from this module + AliasesToExport = '*' #For performance, list alias explicitly + + # DSC class resources to export from this module. + #DSCResourcesToExport = '' + + # List of all modules packaged with this module + ModuleList = @() + + # List of all files packaged with this module + FileList = @() + + # Private data to pass to the module specified in ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. + PrivateData = @{ + + #Support for PowerShellGet galleries. + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'PSModule', 'Planner', 'MSGraph' + + # A URL to the license for this module. + # LicenseUri = '' + + # A URL to the main website for this project. + # ProjectUri = '' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + # ReleaseNotes = '' + + } # End of PSData hashtable + + } # End of PrivateData hashtable +} + + + + + + + diff --git a/PlannerModule/PlannerModule.psm1 b/PlannerModule/PlannerModule.psm1 new file mode 100644 index 0000000..368c287 --- /dev/null +++ b/PlannerModule/PlannerModule.psm1 @@ -0,0 +1,1321 @@ +<# + .NOTES + -------------------------------------------------------------------------------- + Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2019 v5.6.159 + Generated on: 6/5/2019 12:59 PM + Generated by: yingh + -------------------------------------------------------------------------------- + .DESCRIPTION + Script generated by PowerShell Studio 2019 +#> + + + <# + =========================================================================== + Created on: 6/3/2019 1:55 AM + Created by: Zeng Yinghua + Organization: + Filename: PlannerModule.psm1 + ------------------------------------------------------------------------- + Module Name: PlannerModule + =========================================================================== + + #> + + function Get-PlannerAuthToken + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + Write-Host "Checking for AzureAD module..." + $AadModule = Get-Module -Name "AzureAD" -ListAvailable + if ($AadModule -eq $null) + { + Write-Host "AzureAD PowerShell module not found, looking for AzureADPreview" + $AadModule = Get-Module -Name "AzureADPreview" -ListAvailable + } + if ($AadModule -eq $null) + { + Write-Error "AzureAD Powershell module not installed..." + Write-Error "Install by running 'Install-Module AzureAD' or 'Install-Module AzureADPreview' from an elevated PowerShell prompt" + exit + } + + # Getting path to ActiveDirectory Assemblies + # If the module count is greater than 1 find the latest version + + if ($AadModule.count -gt 1) + { + $Latest_Version = ($AadModule | Select-Object version | Sort-Object)[-1] + $aadModule = $AadModule | ForEach-Object { $_.version -eq $Latest_Version.version } + + # Checking if there are multiple versions of the same module found + if ($AadModule.count -gt 1) + { + $aadModule = $AadModule | Select-Object -Unique + } + $adal = Join-Path $AadModule.ModuleBase "Microsoft.IdentityModel.Clients.ActiveDirectory.dll" + $adalforms = Join-Path $AadModule.ModuleBase "Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll" + } + else + { + $adal = Join-Path $AadModule.ModuleBase "Microsoft.IdentityModel.Clients.ActiveDirectory.dll" + $adalforms = Join-Path $AadModule.ModuleBase "Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll" + } + + [System.Reflection.Assembly]::LoadFrom($adal) | Out-Null + [System.Reflection.Assembly]::LoadFrom($adalforms) | Out-Null + + if ($PlannerEnvUpdated -ne $true) + { + $clientId = "3556cd23-09eb-42b3-a3b9-72cba5c7926e" + } + $redirectUri = "urn:ietf:wg:oauth:2.0:oob" + $resourceAppIdURI = "https://graph.microsoft.com" + $authority = "https://login.microsoftonline.com/common" + + try + { + $authContext = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext" -ArgumentList $authority + + # https://msdn.microsoft.com/en-us/library/azure/microsoft.identitymodel.clients.activedirectory.promptbehavior.aspx + # Change the prompt behaviour to force credentials each time: Auto, Always, Never, RefreshSession + + $platformParameters = New-Object "Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters" -ArgumentList "Always" + $authResult = $authContext.AcquireTokenAsync($resourceAppIdURI, $clientId, $redirectUri, $platformParameters).Result + + # If the accesstoken is valid then create the authentication header + if ($authResult.AccessToken) + { + # Creating header for Authorization token + $authHeader = @{ + 'Content-Type' = 'application/json' + 'Authorization' = "Bearer " + $authResult.AccessToken + 'ExpiresOn' = $authResult.ExpiresOn + } + return $authHeader + } + else + { + Write-Error "Authorization Access Token is null, please re-run authentication..." + break + } + } + catch + { + Write-Error $_.Exception.Message + Write-Error $_.Exception.ItemName + break + } + } + + function Update-PlannerModuelEnvironment + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [cmdletbinding()] + param + ( + [Parameter(Mandatory = $false)] + [string]$ClientId + ) + + Write-Warning "WARNING: Call the 'Connect-Planner' cmdlet to use the updated environment parameters." + + Write-Host " + AuthUrl : https://login.microsoftonline.com/common + ResourceId : https://graph.microsoft.com + GraphBaseAddress : https://graph.microsoft.com + AppId : $ClientId + RedirectLink : urn:ietf:wg:oauth:2.0:oob + SchemaVersion : beta + +" + $Global:ClientId = $($ClientId) + $Global:PlannerEnvUpdated = $true + } + + + Function Invoke-ListUnifiedGroups + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + try + { + $uri = "https://graph.microsoft.com/beta/Groups?`$filter=groupTypes/any(c:c+eq+'Unified')" + (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + + } + + Function New-AADUnifiedGroup + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [cmdletbinding()] + param + ( + [Parameter(Mandatory = $True)] + [string]$GroupName, + [Parameter(Mandatory = $True)] + [ValidateNotNullOrEmpty()] + [ValidateSet("Public", "Private")] + $visibility = "Private" + ) + + $randomNum = (Get-Random -Maximum 1000).tostring() + $mailNickname = $GroupName.Replace(" ", "") + $randomNum + + try + { + $Body = @" +{ + "description": "$($GroupName)", + "displayName": "$($GroupName)", + "groupTypes": [ + "Unified" + ], + "mailEnabled": true, + "mailNickname": "$($mailNickname)", + "securityEnabled": false, + "visibility": "Private" +} +"@ + + $uri = "https://graph.microsoft.com/beta/groups" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method POST -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + + } + + Function Add-AADUnifiedGroupMember + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [cmdletbinding()] + param + ( + [Parameter(Mandatory = $True)] + [string]$GroupName, + [Parameter(Mandatory = $True)] + [array]$UserPrincipalNames + ) + + + + #Get Group ID + $GroupID = (Get-PlannerPlanGroup -GroupName $GroupName).id + + foreach ($UserPrincipalName in $UserPrincipalNames) + { + try + { + + #Get users id + $userID = (Get-AADUser -UserPrincipalName $UserPrincipalName).id + + $Body = @" +{ + "@odata.id": "https://graph.microsoft.com/beta/directoryObjects/$($userID)" +} +"@ + $uri = "https://graph.microsoft.com/beta/groups/$GroupID/members/`$ref" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method POST -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + + } + + Function Get-PlannerPlanGroup + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [cmdletbinding()] + param + ( + [string]$GroupName + ) + + try + { + $uri = "https://graph.microsoft.com/beta/Groups?`$filter=groupTypes/any(c:c+eq+'Unified')+and+displayName+eq+`'$Groupname`'" + (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).Value + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + + } + + Function Invoke-ListPlannerPlans + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True, ParameterSetName = 'GroupID')] + [Alias("id")] + $GroupID, + [Parameter(Mandatory = $True, ParameterSetName = 'GroupName')] + $GroupName + ) + + Process + { + try + { + switch ($PsCmdlet.ParameterSetName) + { + 'GroupName' + { + $GroupID = (Get-PlannerPlanGroup -GroupName $($GroupName)).id + } + } + $Uri = "https://graph.microsoft.com/beta/groups/$GroupID/planner/plans" + (Invoke-RestMethod -uri $Uri -Headers $authToken -Method Get).value + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Get-PlannerPlan + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$PlanID + ) + + Process + { + try + { + $uri = "https://graph.microsoft.com/beta/planner/plans/$PlanID" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Invoke-ListPlannerPlanTasks + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$PlanID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/plans/$PlanID/tasks" + (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + + } + + Function Invoke-ListPlannerPlanBuckets + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$PlanID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/plans/$PlanID/buckets" + (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Get-PlannerTask + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$TaskID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/tasks/$TaskID" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Get-PlannerTaskDetails + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$TaskID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta//planner/tasks/$TaskID/details" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Get-PlannerPlanDetails + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$PlanID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/plans/$PlanID/details" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Get-PlannerBucket + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$BucketID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/buckets/$BucketID" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Invoke-ListPlannerBucketTasks + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$BucketID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/buckets/$BucketID/tasks" + (Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get).value + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Get-PlannerAssignedToTaskBoardTaskFormat + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$TaskID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/tasks/$TaskID/assignedToTaskBoardFormat" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Get-PlannerBucketTaskBoardTaskFormat + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$TaskID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/tasks/$TaskID/bucketTaskBoardFormat" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Get-PlannerProgressTaskBoardTaskFormat + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + [string[]]$TaskID + ) + + Process + { + try + { + + $uri = "https://graph.microsoft.com/beta/planner/tasks/$TaskID/progressTaskBoardFormat" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method Get + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function New-PlannerPlan + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + + [Parameter(Mandatory = $true)] + $PlanName, + [Parameter(Mandatory = $True)] + [ValidateNotNullOrEmpty()] + [ValidateSet("Public", "Private")] + $visibility = "Private" + ) + + + $GroupInfo = Get-PlannerPlanGroup -GroupName $($PlanName) -ErrorAction SilentlyContinue + if ($GroupInfo) + { + $GroupID = $GroupInfo.id + } + else + { + $results = New-AADUnifiedGroup -GroupName $($PlanName) -visibility $($visibility) + Start-Sleep 10 + #Get current user + $uri = "https://graph.microsoft.com/beta/me" + $UserPrincipalName = (Invoke-RestMethod -Uri $uri -Headers $authToken -Method GET).UserPrincipalName + Add-AADUnifiedGroupMember -GroupName $PlanName -UserPrincipalName $UserPrincipalName + $GroupID = $results.id + Start-Sleep 10 + } + + + $Body = @" +{ + "owner": "$($GroupID)", + "title": "$($PlanName)" +} +"@ + + try + { + $uri = "https://graph.microsoft.com/beta/planner/plans" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method POST -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + + Function New-PlannerPlanToGroup + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + + [Parameter(Mandatory = $true)] + $PlanName, + [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $True)] + [Alias("id")] + $GroupID + ) + + #Add current user to group + #Get current user + $uri = "https://graph.microsoft.com/beta/me" + $UserID = (Invoke-RestMethod -Uri $uri -Headers $authToken -Method GET).id + $uri = "https://graph.microsoft.com/beta/Groups/$GroupID/members?`$filter=id eq '$UserID'" + + try + { + Invoke-RestMethod -Uri $uri -Headers $authToken -Method GET + } + catch + { + $AddUser = $true + } + if ($AddUser -eq $true) + { + try + { + $Body = @" +{ + "@odata.id": "https://graph.microsoft.com/beta/directoryObjects/$($userID)" +} +"@ + + $uri = "https://graph.microsoft.com/beta/groups/$GroupID/members/`$ref" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method POST -Body $Body + Start-Sleep 10 + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "$($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + + $Body = @" +{ + "owner": "$($GroupID)", + "title": "$($PlanName)" +} +"@ + + try + { + $uri = "https://graph.microsoft.com/beta/planner/plans" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method POST -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + + Function New-PlannerBucket + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True, ParameterSetName = 'PlanID')] + [Alias("id")] + $PlanID, + [Parameter(Mandatory = $True)] + $BucketName + ) + + Process + { + $Body = @" +{ + "name": "$($BucketName)", + "planId": "$($PlanID)", + "orderHint": " !" +} +"@ + + try + { + $uri = "https://graph.microsoft.com/beta/planner/buckets" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method POST -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function New-PlannerTask + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True, ParameterSetName = 'PlanID')] + [Alias("id")] + $PlanID, + [Parameter(Mandatory = $True)] + $TaskName, + [Parameter(Mandatory = $False)] + $BucketID, + [Parameter(Mandatory = $False, HelpMessage = "DateTime format needs to be YYYY-MM-DD, example 2019-06-30")] + [DateTime]$startDate, + [Parameter(Mandatory = $False, HelpMessage = "DateTime format needs to be YYYY-MM-DD, example 2019-06-30")] + [DateTime]$dueDate + ) + + #user defualt bucket name To do + If (!$BucketID) + { + $BucketID = (Invoke-ListPlannerPlanBuckets -PlanID $($PlanID) | Where-Object { $_.name -like 'To do' }).id + } + + #if start date and due date is not definde + if (!$startDate -and !$dueDate) + { + $Body = @" +{ + "planId": "$($PlanID)", + "bucketId": "$($BucketID)", + "title": "$($TaskName)", +} +"@ + } + + #if start date is due date are definded + if ($startDate -and $dueDate) + { + $startDateformat = $startDate.ToString("yyyy-MM-ddT10:00:00Z") + $dueDateformat = $dueDate.ToString("yyyy-MM-ddT10:00:00Z") + + $Body = @" +{ + "planId": "$($PlanID)", + "bucketId": "$($BucketID)", + "title": "$($TaskName)", + "startDateTime": "$($startDateformat)", + "dueDateTime": "$($dueDateformat)" +} +"@ + } + + #if no start date, but has duedate + if (!$startDate -and $dueDate) + { + $dueDateformat = $dueDate.ToString("yyyy-MM-ddT10:00:00Z") + + $Body = @" +{ + "planId": "$($PlanID)", + "bucketId": "$($BucketID)", + "title": "$($TaskName)", + "dueDateTime": "$($dueDateformat)" +} +"@ + } + + #if has start date, but no due date + if ($startDate -and !$dueDate) + { + $startDateformat = $startDate.ToString("yyyy-MM-ddT10:00:00Z") + + $Body = @" +{ + "planId": "$($PlanID)", + "bucketId": "$($BucketID)", + "title": "$($TaskName)", + "startDateTime": "$($startDateformat)" +} +"@ + } + + #Make graph call + try + { + $uri = "https://graph.microsoft.com/beta/planner/tasks" + Invoke-RestMethod -Uri $uri -Headers $authToken -Method POST -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + + Function Get-AADUser + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True)] + $UserPrincipalName + ) + + + try + { + $uri = "https://graph.microsoft.com/beta/users?`$filter=userPrincipalName eq '$($UserPrincipalName)'" + (Invoke-RestMethod -Uri $uri -Headers $authToken -Method GET).value + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + + Function Invoke-AssignPlannerTask + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True, ParameterSetName = 'TaskID')] + [Alias("id")] + $TaskID, + [Parameter(Mandatory = $True)] + [array]$UserPrincipalNames + ) + + foreach ($UserPrincipalName in $UserPrincipalNames) + { + #Get users id + $userID = (Get-AADUser -UserPrincipalName $UserPrincipalName).id + + #Get Task details + $respond = Get-PlannerTask -TaskID $TaskID + $ETag = $respond.'@odata.etag' + + $Body = @" +{ + "assignments": { + "$($userID)": { + "@odata.type": "#microsoft.graph.plannerAssignment", + "orderHint": " !" + } + } +} +"@ + #Add if-match to new tocket header + $NewToken = $authToken.Clone() + $NewToken.add("If-Match", $ETag) + + try + { + $uri = "https://graph.microsoft.com/beta/planner/tasks/$($TaskID)" + Invoke-RestMethod -Uri $uri -Headers $NewToken -Method PATCH -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + } + } + + Function Update-PlannerPlanCategories + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True, ParameterSetName = 'PlanID')] + [Alias("id")] + $PlanID, + [Parameter(Mandatory = $false)] + $category1 = 'null', + $category2 = 'null', + $category3 = 'null', + $category4 = 'null', + $category5 = 'null', + $category6 = 'null' + ) + + #Get Plan details + $respond = Get-PlannerPlanDetails -PlanID $PlanID + $ETag = $respond.'@odata.etag' + + $Body = @" +{ + "categoryDescriptions": { + "category1": "$category1", + "category2": "$category2", + "category3": "$category3", + "category4": "$category4", + "category5": "$category5", + "category6": "$category6" + } +} +"@ + + #Add if-match to new tocket header + $NewToken = $authToken.Clone() + $NewToken.add("If-Match", $ETag) + + try + { + $uri = "https://graph.microsoft.com/beta/planner/plans/$($PlanID)/details" + Invoke-RestMethod -Uri $uri -Headers $NewToken -Method PATCH -Body $Body + + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + + } + + Function Invoke-AssignPlannerTaskCategories + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True, ParameterSetName = 'TaskID')] + [Alias("id")] + $TaskID, + [Parameter(Mandatory = $True)] + [bool]$category1 = $false, + [bool]$category2 = $false, + [bool]$category3 = $false, + [bool]$category4 = $false, + [bool]$category5 = $false, + [bool]$category6 = $false + ) + + #Get Task details + $respond = Get-PlannerTask -TaskID $TaskID + $ETag = $respond.'@odata.etag' + + $Body = @" +{ + "appliedCategories": { + "category1": $($category1.tostring().ToLower()), + "category2": $($category2.tostring().ToLower()), + "category3": $($category3.tostring().ToLower()), + "category4": $($category4.tostring().ToLower()), + "category5": $($category5.tostring().ToLower()), + "category6": $($category6.tostring().ToLower()) + } +} +"@ + + #Add if-match to new tocket header + $NewToken = $authToken.Clone() + $NewToken.add("If-Match", $ETag) + + try + { + $uri = "https://graph.microsoft.com/beta/planner/tasks/$($TaskID)" + Invoke-RestMethod -Uri $uri -Headers $NewToken -Method PATCH -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + + } + + Function Add-PlannerTaskDescription + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True, ParameterSetName = 'TaskID')] + [Alias("id")] + $TaskID, + [Parameter(Mandatory = $True)] + [string[]]$Description + ) + + #Get Task details + $respond = Get-PlannerTaskDetails -TaskID $TaskID + $ETag = $respond.'@odata.etag' + + $Body = @" +{ + "description": "$($Description)" +} +"@ + + #Add if-match to new tocket header + $NewToken = $authToken.Clone() + $NewToken.add("If-Match", $ETag) + + try + { + $uri = "https://graph.microsoft.com/beta/planner/tasks/$($TaskID)/Details" + Invoke-RestMethod -Uri $uri -Headers $NewToken -Method PATCH -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + + } + + Function Add-PlannerTaskChecklist + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + param + ( + [Parameter(Mandatory = $True, ValueFromPipelineByPropertyName = $True, ParameterSetName = 'TaskID')] + [Alias("id")] + $TaskID, + [Parameter(Mandatory = $True)] + [string[]]$Title, + [bool]$IsChecked = $false + ) + + #Get Task details + $respond = Get-PlannerTaskDetails -TaskID $TaskID + $ETag = $respond.'@odata.etag' + + $checklist = (New-Guid).Guid + + $Body = @" +{ + "checklist": { + "$checklist": { + "@odata.type": "#microsoft.graph.plannerChecklistItem", + "isChecked": $($IsChecked.tostring().ToLower()), + "title": "$($Title)" + } + } +} +"@ + + #Add if-match to new tocket header + $NewToken = $authToken.Clone() + $NewToken.add("If-Match", $ETag) + + try + { + $uri = "https://graph.microsoft.com/beta/planner/tasks/$($TaskID)/Details" + Invoke-RestMethod -Uri $uri -Headers $NewToken -Method PATCH -Body $Body + } + catch + { + $ex = $_.Exception + if ($($ex.Response.StatusDescription) -match 'Unauthorized') + { + Write-Error "Unauthorized, Please check your permissions and use the 'Connect-Planner' command to authenticate" + } + Write-Error "Request to $Uri failed with HTTP Status $($ex.Response.StatusCode) $($ex.Response.StatusDescription)" + break + } + + } + + Function Connect-Planner + { + # .ExternalHelp PlannerModule.psm1-Help.xml + + [CmdletBinding()] + [OutputType([Bool])] + Param + ( + [Parameter(Mandatory = $false, Position = 0)] + [ValidateNotNullOrEmpty()] + [ValidateSet($false, $true)] + $ForceNonInteractive + ) + + + #region Authentication + + if ($ForceNonInteractive -eq $true) + { + # Getting the authorization token + $global:authToken = Get-PlannerAuthToken + } + + # Checking if authToken exists before running authentication + if ($global:authToken) + { + # Setting DateTime to Universal time to work in all timezones + $DateTime = (Get-Date).ToUniversalTime() + + # If the authToken exists checking when it expires + $TokenExpires = ($authToken.ExpiresOn.datetime - $DateTime).Minutes + if ($TokenExpires -le 0) + { + Write-Host "Authentication Token expired" $TokenExpires "minutes ago" + $global:authToken = Get-PlannerAuthToken + } + } + # Authentication doesn't exist, calling Get-AuthToken function + else + { + # Getting the authorization token + $global:authToken = Get-PlannerAuthToken -User $User + } + #endregion + + #################################################### + } \ No newline at end of file diff --git a/PlannerModule/en-US/PlannerModule.psm1-Help.xml b/PlannerModule/en-US/PlannerModule.psm1-Help.xml new file mode 100644 index 0000000..9bddce6 --- /dev/null +++ b/PlannerModule/en-US/PlannerModule.psm1-Help.xml @@ -0,0 +1,2809 @@ + + + + + + + + + + + Add-AADUnifiedGroupMember + + + + + + + Add + AADUnifiedGroupMember + + + + Add user to Azure AD Office 365 Groups + + + + + + Add-AADUnifiedGroupMember + + GroupName + + + + String + + String + + + + + + UserPrincipalNames + + + + Array + + Array + + + + + + + + + + GroupName + + + + String + + String + + + + + + UserPrincipalNames + + + + Array + + Array + + + + + + + + + + + Add-PlannerTaskChecklist + + + + + + + Add + PlannerTaskChecklist + + + + Add checklist to Planner Task + + + + + + Add-PlannerTaskChecklist + + TaskID + + Input Planner Plan task ID + + Object + + Object + + + + + + Title + + Input check list title + + String[] + + String[] + + + + + + IsChecked + + $True for isChecked, $False for is not checked + + Boolean + + Boolean + + + + + + + + + + TaskID + + Input Planner Plan task ID + + Object + + Object + + + + + + Title + + Input check list title + + String[] + + String[] + + + + + + IsChecked + + $True for isChecked, $False for is not checked + + Boolean + + Boolean + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + + EXAMPLE 1 + + + + C:\PS> Add-PlannerTaskChecklist -TaskID " + + + + + + + + + + + Add-PlannerTaskDescription + + + + + + + Add + PlannerTaskDescription + + + + Add Planner Plan Task Descriptions + + + + + + Add-PlannerTaskDescription + + TaskID + + + + Object + + Object + + + + + + Description + + + + String[] + + String[] + + + + + + + + + + TaskID + + + + Object + + Object + + + + + + Description + + + + String[] + + String[] + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Connect-Planner + + + + + + + Connect + Planner + + + + Authenticates with Planner Graph + + + + + + Connect-Planner + + ForceNonInteractive + + + + Object + + False + True + + + Object + + + + + + + + + + ForceNonInteractive + + + + Object + + False + True + + + Object + + + + + + + + + + None + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-AADUser + + + + + + + Get + AADUser + + + + Get Azure AD user information + + + + + + Get-AADUser + + UserPrincipalName + + + + Object + + Object + + + + + + + + + + UserPrincipalName + + + + Object + + Object + + + + + + + + + + None + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-PlannerAssignedToTaskBoardTaskFormat + + + + + + + Get + PlannerAssignedToTaskBoardTaskFormat + + + + Retrieve Planner AssignedToTaskBoardTaskFormat, Graph call + + + + + + Get-PlannerAssignedToTaskBoardTaskFormat + + TaskID + + + + String[] + + String[] + + + + + + + + + + TaskID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + Get-PlannerAuthToken + + + + + + + Get + PlannerAuthToken + + + + + + + + + + Get-PlannerAuthToken + + + + + + + + + + None + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-PlannerBucket + + + + + + + Get + PlannerBucket + + + + Retrieve Planner Bucket, Graph call + + + + + + Get-PlannerBucket + + BucketID + + + + String[] + + String[] + + + + + + + + + + BucketID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-PlannerBucketTaskBoardTaskFormat + + + + + + + Get + PlannerBucketTaskBoardTaskFormat + + + + Retrieve Planner BucketTaskBoardTaskFormat, Graph call + + + + + + Get-PlannerBucketTaskBoardTaskFormat + + TaskID + + + + String[] + + String[] + + + + + + + + + + TaskID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-PlannerPlan + + + + + + + Get + PlannerPlan + + + + Retrieve Planner Plan, Graph call + + + + + + Get-PlannerPlan + + PlanID + + + + String[] + + String[] + + + + + + + + + + PlanID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-PlannerPlanDetails + + + + + + + Get + PlannerPlanDetails + + + + Retrieve PPlanner Plan Details, Graph call + + + + + + Get-PlannerPlanDetails + + PlanID + + + + String[] + + String[] + + + + + + + + + + PlanID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-PlannerPlanGroup + + + + + + + Get + PlannerPlanGroup + + + + Retrieve Planner Plan Group, Graph call + + + + + + Get-PlannerPlanGroup + + GroupName + + + + String + + String + + + + + + + + + + GroupName + + + + String + + String + + + + + + + + + EXAMPLE 1 + + + + C:\PS> Get-PlannerPlanGroup -GroupName "Test Planner Group" + + + + + + + + + + + Get-PlannerProgressTaskBoardTaskFormat + + + + + + + Get + PlannerProgressTaskBoardTaskFormat + + + + Retrieve Planner ProgressTaskBoardTaskFormat, Graph call + + + + + + Get-PlannerProgressTaskBoardTaskFormat + + TaskID + + + + String[] + + String[] + + + + + + + + + + TaskID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-PlannerTask + + + + + + + Get + PlannerTask + + + + Retrieve Planner Task, Graph call + + + + + + Get-PlannerTask + + TaskID + + + + String[] + + String[] + + + + + + + + + + TaskID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Get-PlannerTaskDetails + + + + + + + Get + PlannerTaskDetails + + + + Retrieve Planner Task Details, Graph call + + + + + + Get-PlannerTaskDetails + + TaskID + + + + String[] + + String[] + + + + + + + + + + TaskID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Invoke-AssignPlannerTask + + + + + + + Invoke + AssignPlannerTask + + + + Assign Planner Task to user, Graph call + + + + + + Invoke-AssignPlannerTask + + TaskID + + + + Object + + Object + + + + + + UserPrincipalNames + + + + Array + + Array + + + + + + + + + + TaskID + + + + Object + + Object + + + + + + UserPrincipalNames + + + + Array + + Array + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Invoke-AssignPlannerTaskCategories + + + + + + + Invoke + AssignPlannerTaskCategories + + + + Assign Planner Task label, Graph call + + + + + + Invoke-AssignPlannerTaskCategories + + TaskID + + + + Object + + Object + + + + + + category1 + + + + Boolean + + Boolean + + + + + + category2 + + + + Boolean + + Boolean + + + + + + category3 + + + + Boolean + + Boolean + + + + + + category4 + + + + Boolean + + Boolean + + + + + + category5 + + + + Boolean + + Boolean + + + + + + category6 + + + + Boolean + + Boolean + + + + + + + + + + TaskID + + + + Object + + Object + + + + + + category1 + + + + Boolean + + Boolean + + + + + + category2 + + + + Boolean + + Boolean + + + + + + category3 + + + + Boolean + + Boolean + + + + + + category4 + + + + Boolean + + Boolean + + + + + + category5 + + + + Boolean + + Boolean + + + + + + category6 + + + + Boolean + + Boolean + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Invoke-ListPlannerBucketTasks + + + + + + + Invoke + ListPlannerBucketTasks + + + + List Planner Bucket Tasks, Graph call + + + + + + Invoke-ListPlannerBucketTasks + + BucketID + + + + String[] + + String[] + + + + + + + + + + BucketID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Invoke-ListPlannerPlanBuckets + + + + + + + Invoke + ListPlannerPlanBuckets + + + + List Planner Plan Buckets, Graph call + + + + + + Invoke-ListPlannerPlanBuckets + + PlanID + + + + String[] + + String[] + + + + + + + + + + PlanID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + EXAMPLE 1 + + + + C:\PS> Invoke-ListPlannerPlans -GroupID "0e0a7683-530c-42e5-9f76-27f9f6fac354" | Invoke-ListPlannerPlanBuckets + + + + + + EXAMPLE 2 + + + + C:\PS> Invoke-ListPlannerPlanBuckets -PlanID "e69bhAurV0GOMGgj0iV00ZcADZu2" + + + + + + + + + + + Invoke-ListPlannerPlans + + + + + + + Invoke + ListPlannerPlans + + + + List Planner Plans, Graph call + + + + + + Invoke-ListPlannerPlans + + GroupID + + + + Object + + Object + + + + + + + + Invoke-ListPlannerPlans + + GroupName + + + + Object + + Object + + + + + + + + + + GroupID + + + + Object + + Object + + + + + + GroupName + + + + Object + + Object + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + + EXAMPLE 1 + + + + C:\PS> Get-PlannerPlanGroup -GroupName "Test Planner Group" | Invoke-ListPlannerPlans + + + + + + EXAMPLE 2 + + + + C:\PS> Invoke-ListPlannerPlans -GroupID "0e0a7683-530c-42e5-9f76-27f9f6fac354" + + + + + + + + + + + Invoke-ListPlannerPlanTasks + + + + + + + Invoke + ListPlannerPlanTasks + + + + List Planner Plan Tasks Graph call + + + + + + Invoke-ListPlannerPlanTasks + + PlanID + + + + String[] + + String[] + + + + + + + + + + PlanID + + + + String[] + + String[] + + + + + + + + + + System.String[] + + + + + + + + + + + + System.Object + + + + + + + + + + + EXAMPLE 1 + + + + C:\PS> Invoke-ListPlannerPlans -GroupID "0e0a7683-530c-42e5-9f76-27f9f6fac354" | Invoke-ListPlannerPlanTasks + + + + + + EXAMPLE 2 + + + + C:\PS> Invoke-ListPlannerPlanTasks -PlanID "e69bhAurV0GOMGgj0iV00ZcADZu2" + + + + + + + + + + Invoke-ListUnifiedGroups + + + + + + + Invoke + ListUnifiedGroups + + + + + + + + + + Invoke-ListUnifiedGroups + + + + + + + + + + + New-AADUnifiedGroup + + + + + + + New + AADUnifiedGroup + + + + Create new Azure AD office 365 Group + + + + + + New-AADUnifiedGroup + + GroupName + + + + String + + String + + + + + + visibility + + + + Object + + Public + Private + + + Object + + + Private + + + + + + + GroupName + + + + String + + String + + + + + + visibility + + + + Object + + Public + Private + + + Object + + + Private + + + + + + + + New-PlannerBucket + + + + + + + New + PlannerBucket + + + + Create Planner Bucket, Graph call + + + + + + New-PlannerBucket + + PlanID + + + + Object + + Object + + + + + + BucketName + + + + Object + + Object + + + + + + + + + + PlanID + + + + Object + + Object + + + + + + BucketName + + + + Object + + Object + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + + + + New-PlannerPlan + + + + + + + New + PlannerPlan + + + + Create Planner Plan and new O365 Group + + + + + + New-PlannerPlan + + PlanName + + + + Object + + Object + + + + + + visibility + + + + Object + + Public + Private + + + Object + + + + + + + + + + PlanName + + + + Object + + Object + + + + + + visibility + + + + Object + + Public + Private + + + Object + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + + + + New-PlannerPlanToGroup + + + + + + + New + PlannerPlanToGroup + + + + Create Planner Plan and using existing O365 Group + + + + + + New-PlannerPlanToGroup + + PlanName + + + + Object + + Object + + + + + + GroupID + + + + Object + + Object + + + + + + + + + + PlanName + + + + Object + + Object + + + + + + GroupID + + + + Object + + Object + + + + + + + + + + System.Object + + + + + + + + + + + + + New-PlannerTask + + + + + + + New + PlannerTask + + + + Create Planner Plan task, Graph call + + + + + + New-PlannerTask + + PlanID + + + + Object + + Object + + + + + + TaskName + + + + Object + + Object + + + + + + BucketID + + + + Object + + Object + + + + + + startDate + + DateTime format needs to be YYYY-MM-DD, example 2019-06-30 + + DateTime + + DateTime + + + + + + dueDate + + DateTime format needs to be YYYY-MM-DD, example 2019-06-30 + + DateTime + + DateTime + + + + + + + + + + PlanID + + + + Object + + Object + + + + + + TaskName + + + + Object + + Object + + + + + + BucketID + + + + Object + + Object + + + + + + startDate + + DateTime format needs to be YYYY-MM-DD, example 2019-06-30 + + DateTime + + DateTime + + + + + + dueDate + + DateTime format needs to be YYYY-MM-DD, example 2019-06-30 + + DateTime + + DateTime + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + + + + Update-PlannerModuelEnvironment + + + + + + + Update + PlannerModuelEnvironment + + + + Update Planner Module Client ID to your own app ID + + + + + + Update-PlannerModuelEnvironment + + ClientId + + + + String + + String + + + + + + + + + + ClientId + + + + String + + String + + + + + + + + + + + Update-PlannerPlanCategories + + + + + + + Update + PlannerPlanCategories + + + + Update Planner Plan Categories, Graph call + + + + + + Update-PlannerPlanCategories + + PlanID + + + + Object + + Object + + + + + + category1 + + + + Object + + Object + + + + + + category2 + + + + Object + + Object + + + + + + category3 + + + + Object + + Object + + + + + + category4 + + + + Object + + Object + + + + + + category5 + + + + Object + + Object + + + + + + category6 + + + + Object + + Object + + + + + + + + + + PlanID + + + + Object + + Object + + + + + + category1 + + + + Object + + Object + + + + + + category2 + + + + Object + + Object + + + + + + category3 + + + + Object + + Object + + + + + + category4 + + + + Object + + Object + + + + + + category5 + + + + Object + + Object + + + + + + category6 + + + + Object + + Object + + + + + + + + + + System.Object + + + + + + + + + + + + System.Object + + + + + + + + + + \ No newline at end of file diff --git a/PlannerModule/en-US/about_PlannerModule.Help.txt b/PlannerModule/en-US/about_PlannerModule.Help.txt new file mode 100644 index 0000000..479a9a1 --- /dev/null +++ b/PlannerModule/en-US/about_PlannerModule.Help.txt @@ -0,0 +1,25 @@ +TOPIC + about_PlannerModule + +SHORT DESCRIPTION + This is a short description of the file. + +LONG DESCRIPTION + This is a long description of the file. + +NOTE + This is a note. + +TROUBLESHOOTING NOTE + + + +EXAMPLES + Place examples here. + +KEYWORDS + + + +SEE ALSO + Place related topics here. \ No newline at end of file