This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-AIChat { | |
<# | |
.SYNOPSIS | |
Invokes an AI chat model to generate responses based on user prompts. | |
.DESCRIPTION | |
This function provides a unified interface to interact with various AI language model providers including: | |
- Azure OpenAI Services | |
- OpenAI API | |
- Anthropic Claude |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-GoogleAIChat { | |
<# | |
.SYNOPSIS | |
PowerShell function for Google Chat API interaction via REST. | |
.DESCRIPTION | |
Provides a robust interface to Google Chat API with features including: | |
- Conversation history management | |
- Token usage tracking | |
- Markdown rendering support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-OpenAIChat { | |
<# | |
.SYNOPSIS | |
PowerShell function for OpenAI Chat API interaction via REST. | |
.DESCRIPTION | |
Provides a robust interface to OpenAI Chat API with features including: | |
- Conversation history management | |
- Token usage tracking | |
- Markdown rendering support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-AnthropicAIChat { | |
<# | |
.SYNOPSIS | |
PowerShell function for Anthropic (Claude) AI Chat API interaction via REST. | |
.DESCRIPTION | |
Provides a robust interface to Anthropic (Claude) AI Chat API with features including: | |
- Conversation history management | |
- Token usage tracking | |
- Markdown rendering support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-AzOpenAIChat { | |
<# | |
.SYNOPSIS | |
PowerShell function for Azure OpenAI Chat API interaction via REST. | |
.DESCRIPTION | |
Provides a robust interface to Azure OpenAI Chat API with features including: | |
- Conversation history management | |
- Token usage tracking | |
- Markdown rendering support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-EntraAccessToken { | |
[CmdletBinding(DefaultParameterSetName = 'Default')] | |
param ( | |
[Parameter(ParameterSetName = "UseWAM")] | |
[Parameter(ParameterSetName = "GraphSDK")] | |
[Parameter(ParameterSetName = "ACRSClaim")] | |
[Parameter(ParameterSetName = "AzureIdentity")] | |
[Parameter(ParameterSetName = "Default")] | |
[string] | |
$ClientId = "14d82eec-204b-4c2f-b7e8-296a70dab67e", # Microsoft Graph PowerShell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-EntraAccessTokenWithWAM { | |
[CmdletBinding()] | |
param ( | |
[Parameter()] | |
[string] | |
$ClientId = "14d82eec-204b-4c2f-b7e8-296a70dab67e", # Microsoft Graph PowerShell | |
[Parameter()] | |
[string[]] | |
$Scopes = "https://graph.microsoft.com/.default", | |
[Parameter()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use this code to retrieve all Conditional Access policies that use authentication context from Microsoft Graph | |
Connect-MgGraph | |
$policies = Get-MgIdentityConditionalAccessPolicy | Where-Object { $_.Conditions.Applications.IncludeAuthenticationContextClassReferences -ne $null } | |
$policies | ForEach-Object { | |
[PSCustomObject]@{ | |
DisplayName = $_.DisplayName | |
State = $_.State | |
AuthContext = $_.Conditions.Applications.IncludeAuthenticationContextClassReferences | |
} | |
} | Format-Table -AutoSize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the xaml code for the window | |
[xml]$xaml = @' | |
<Window | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
Title="Let's Eat!" | |
ThemeMode="Dark" | |
SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen" > | |
<Grid> | |
<TabControl Margin="5"> | |
<TabItem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define the xaml code for the window | |
[xml]$xaml = @' | |
<Window | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
Title="Let's Eat!" | |
SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen" > | |
<Grid> | |
<TabControl Margin="5"> | |
<TabItem> | |
<TabItem.Header> |
NewerOlder