Skip to content

Instantly share code, notes, and snippets.

View MigrateTeams.ps1
$csvFile = "C:\temp\teamslist.csv"
#List of team object IDs. Header in CSV is ID.
$table = Import-Csv $csvFile -Delimiter ","
$source = Connect-Tenant -Domain contoso.onmicrosoft.com -Browser
$destination = Connect-Tenant -Domain tailspin.onmicrosoft.com -Browser
foreach ($row in $table) {
$team = Get-Team -id $($row.id) -Tenant $source
View ChatRights.ps1
$TenantID = "xxxxxx"
$LogicAppSeObjectID = "xxxxxxx"
$ServicePrincipalId = $LogicAppSeObjectID
$GraphResource = Get-MgServicePrincipal -Filter "AppId eq '00000003-0000-0000-c000-000000000000'"
$application_role_to_assign_name = "Chat.Read.All"
$Permission = $GraphResource.AppRoles | Where-Object {$_.value -in $application_role_to_assign_name}
New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $ServicePrincipalId -PrincipalId $ServicePrincipalId -AppRoleId $Permission.Id -ResourceId $GraphResource.Id
View RequestBody.ps1
[
{
@{outputs('Compose_ConversationHistoryReversed_2')}
},
{
"role": "system", "content": "You are a helpful assistant. Format all your replies in HTML code, but dont mention HTML in the response."
}
]
View AzureOpenAIJSON.ps1
{
"properties": {
"choices": {
"items": {
"properties": {
"content_filter_results": {
"properties": {
"hate": {
"properties": {
"filtered": {
View RequestBodyJSON.ps1
{
"items": {
"properties": {
"content": {
"type": "string"
},
"role": {
"type": "string"
}
},
View ConversationHistorySubstring2.ps1
substring(variables('ConversationHistoryReversed'), 1, sub(length(variables('ConversationHistoryReversed')),2))
View ConverSationHistorySubString.ps1
substring(variables('ConversationHistoryReversed'), 1, sub(length(variables('ConversationHistoryReversed')),2))
View ConversationHistoryReversed.ps1
replace(variables('ConversationHistoryReversed'), '</p>', '')