Skip to content

Instantly share code, notes, and snippets.

View AssignGraphRights.ps1
$graphScope = "LearningContent.ReadWrite.All"
$servicePrincipalObjectId = "Enter object ID of Logic App here"
$TenantID = "contoso.onmicrosoft.com"
Install-Module Microsoft.Graph
Connect-MgGraph -Scope “AppRoleAssignment.ReadWrite.All”,”Application.Read.All” -tenantId $TenantID
$graph = Get-MgServicePrincipal -Filter "AppId eq '00000003-0000-0000-c000-000000000000'"
$graphAppRole = $graph.AppRoles | ? Value -eq $graphScope
View newcontent.json
{
"additionalTags": [
"Teams Meetings"
],
"contentWebUrl": "https://alexholmeset.blog/2023/01/25/asdfasdf/",
"contributor": "Alexander Holmeset",
"description": "Put a description here if you have.",
"duration": "PT20M",
"format": "Blog",
"isActive": true,
View contentprovider.json
{
"displayName": "AlexHolmeset.blog",
"squareLogoWebUrlForDarkTheme": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png",
"longLogoWebUrlForDarkTheme": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png",
"squareLogoWebUrlForLightTheme": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png",
"longLogoWebUrlForLightTheme": "https://s.w.org/style/images/about/WordPress-logotype-wmark.png",
"isEnabled": true,
"loginWebUrl": ""
}
View TripletexUsersProjectsHours.ps1
#Authentication
$consumerToken = "xxxxxx"
$employeeToken = "xxxxxx"
#Add your HTTP Trigger URIs from the cloud flows here:
$AddURI = "xxxxx"
$ReadURI = "xxxxx"
$UpdateURI = "xxxxxx"
View UpdateDataverse.json
{
"type": "object",
"properties": {
"RowID": {
"type": "string"
},
"Hours": {
"type": "string"
}
}
View ReadDataverse.json
{
"type": "object",
"properties": {
"TimesheetEntryID": {
"type": "string"
}
}
}
View AddingDataverse.json
{
"type": "object",
"properties": {
"ProjectID": {
"type": "string"
},
"EmployeeName": {
"type": "string"
},
"EmployeeID": {
View CalendarActivityReport.ps1
$TenantId = "xxxxxxxx"
$ClientID = "xxxxxxxxx"
$ClientSecret = "xxxxxxx"
function Get-MSGraphAppToken{
<# .SYNOPSIS
Get an app based authentication token required for interacting with Microsoft Graph API
.PARAMETER TenantID
A tenant ID should be provided.
.PARAMETER ClientID
View TripletexProjects.ps1
$ProjectsURL = "https://tripletex.no/v2/project?from=0"
$Projects = (Invoke-RestMethod -Method Get -uri $ProjectsURL -Headers $Header).values
View TripletexToken.ps1
#Authentication
$consumerToken = "Enter your consumer token here"
$employeeToken = "enter your employee token here"
#Expiration date of the authorization toke you generate is set to 1 day from now.
$expirationDate = get-date ((get-date).Adddays(+1)) -format "yyyy-MM-dd"
$uri = "https://tripletex.no/v2/token/session/:create?consumerToken=$consumerToken&employeeToken=$employeeToken&expirationDate=$expirationDate"
#Get token and create header.
$token = ((Invoke-RestMethod -Method PUT -Uri $uri -ContentType "application/JSON").value).token
$user = '0'