update
This commit is contained in:
33
Teams/Invoke-Webhook.ps1
Normal file
33
Teams/Invoke-Webhook.ps1
Normal file
@ -0,0 +1,33 @@
|
||||
#Définir l'adresse Webhook du canal Teams
|
||||
$webhook = ""
|
||||
|
||||
#Créer le message
|
||||
$body = ConvertTo-Json -depth 3 @{
|
||||
summary = 'Message Teams'
|
||||
themeColor = '0055DD'
|
||||
sections = @(
|
||||
@{
|
||||
activityTitle = "Titre du message `n"
|
||||
activityText = "Ceci est un message généré en PowerShell"
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
#autre exemple de message card
|
||||
$body = @{
|
||||
"@type" = "MessageCard"
|
||||
"@context" = "<http://schema.org/extensions>"
|
||||
"title" = 'Titre'
|
||||
"themeColor" = '0055DD'
|
||||
"text" = "Description"
|
||||
"sections" = @(
|
||||
@{
|
||||
"activityTitle" = 'Titre section'
|
||||
"activitySubtitle" = 'Sous titre'
|
||||
"activityText" = 'Texte de la section'
|
||||
}
|
||||
)
|
||||
} | ConvertTo-JSON
|
||||
|
||||
#Envoyer le message sur Teams
|
||||
Invoke-RestMethod -Method post -ContentType 'Application/Json' -Body $body -Uri $webhook
|
1
Teams/README.md
Normal file
1
Teams/README.md
Normal file
@ -0,0 +1 @@
|
||||
# Teams
|
8
Teams/Start-SecondTeams.ps1
Normal file
8
Teams/Start-SecondTeams.ps1
Normal file
@ -0,0 +1,8 @@
|
||||
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrateur")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
|
||||
|
||||
$username = '.\Username'
|
||||
$password = 'Password'
|
||||
|
||||
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
|
||||
$credential = New-Object System.Management.Automation.PSCredential $username, $securePassword
|
||||
Start-Process 'C:\Users\Username\AppData\Local\Microsoft\Teams\Update.exe' '--processStart "Teams.exe"' -Credential $credential
|
Reference in New Issue
Block a user