-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path7-Ingest-data.ps1
60 lines (53 loc) · 1.95 KB
/
7-Ingest-data.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#-------------------------------------------
# 7-Ingest-data.ps1
#-------------------------------------------
# Create a new item
# https://docs.microsoft.com/en-us/graph/connecting-external-content-connectors-api-postman#step-9---ingest-items
# atwork.at. Toni Pohl
# 2022-12-067T11:04:00Z
$now = Get-Date -Format O
Write-Output $now
$connector = "Conference"
# In real world, use a GUID as Id. This here is just to simplify the Id to make it more readable.
# $itemid = New-Guid
# $itemid = Get-Date -Format "HHmmss"
$itemid = "201"
Write-Output $itemid
$body = @"
{
"acl": [
{
"type": "everyone",
"value": "<some-groupid>",
"accessType": "grant"
}
],
"properties": {
"id": "$itemid",
"title": "The Age of Copilots",
"date": "$now",
"speaker": "Jeff Teper",
"room": "Keynote Room",
"audience": "All",
"type": "KEYNOTE",
"url": "https://m365conf.com/#!/sessions",
"description": "Join Jeff Teper, along with other leaders, to see how new innovation in Microsoft Copilot, combined with the familiarity and scale of Microsoft 365, will unlock productivity and transform business processes for everyone across all functions and every industry in this new era of AI.",
"format": "KEYNOTE",
"level": "100",
"products": "Azure, Microsoft 365"
},
"content": {
"type": "text",
"value": "The Age of Copilots. Join Jeff Teper, along with other leaders, to see how new innovation in Microsoft Copilot, combined with the familiarity and scale of Microsoft 365, will unlock productivity and transform business processes for everyone across all functions and every industry in this new era of AI."
}
}
"@
$result = Invoke-RestMethod `
-Method PUT `
-Uri "https://graph.microsoft.com/v1.0/external/connections/$connector/items/$itemid" `
-ContentType 'application/json' `
-Headers $script:APIHeader `
-Body $body `
-ErrorAction Stop
# Show the result
$result