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
# modified from source: https://github.com/PowerShell/platyPS/issues/595#issuecomment-1820971702 | |
function Remove-CommonParameterFromMarkdown { | |
<# | |
.SYNOPSIS | |
Remove a PlatyPS generated parameter block. | |
.DESCRIPTION | |
Removes parameter block for the provided parameter name from the markdown file provided. | |
#> |
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
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$PowerShellScriptPath, | |
[string]$ApiBase = (Get-Item Env:\AZURE_OPENAI_ENDPOINT).Value, | |
[string]$ApiKey = (Get-Item Env:\AZURE_OPENAI_API_KEY).Value, | |
[string]$ApiVersion = "2023-07-01-preview", | |
[string]$DeploymentId = "gpt-35-turbo-16k" | |
) | |
$Endpoint = "$ApiBase/openai/deployments/$DeploymentId/chat/completions?api-version=$ApiVersion" |
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
Param( | |
[Parameter(Mandatory=$true)] | |
[string]$MarkdownPath, | |
[string]$ApiBase = (Get-Item Env:\AZURE_OPENAI_ENDPOINT).Value, | |
[string]$ApiKey = (Get-Item Env:\AZURE_OPENAI_API_KEY).Value, | |
[string]$ApiVersion = "2023-07-01-preview", | |
[string]$DeploymentId = "gpt-35-turbo-16k" | |
) | |
$Endpoint = "$ApiBase/openai/deployments/$DeploymentId/chat/completions?api-version=$ApiVersion" |
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
$ModulesInPSGallery = Find-Module -Repository PSGallery -Name Az.* | Where-Object { $_.ProjectUri.AbsolutePath -eq "/Azure/azure-powershell" } | |
Import-LocalizedData -BindingVariable AzPreviewMetadata -BaseDirectory .\tools\AzPreview\ -FileName AzPreview.psd1 | |
$ModulesReferencedByAzPreview = $AzPreviewMetadata.RequiredModules.ModuleName | |
$UnRefencedModules = @() | |
foreach ($module in $ModulesInPSGallery) { | |
if (-not $ModulesReferencedByAzPreview.Contains($module.Name)) { | |
$UnRefencedModules += $module | |
} | |
} | |
$UnRefencedModules | Format-Table |
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
# Import目录下所有的psm1文件 | |
function Import-Profile { | |
param( | |
[string] | |
$ProfileDirPath | |
) | |
$Profiles = Get-ChildItem -Recurse -Path $ProfileDirPath | |
foreach ($CustomProfile in $Profiles) { | |
Import-Module $CustomProfile | |
Write-Host "$($CustomProfile.Name) is loaded." -ForegroundColor Green |
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
using namespace System.Management.Automation | |
using namespace System.Management.Automation.Language | |
Set-Alias -Name ll -Value Get-ChildItem | |
Set-Alias Open explorer.exe | |
function Update-PowershellProfile { | |
$GistURL = 'https://gist.githubusercontent.com/wyunchi-ms/bed4d69b122ccf5290fa31ae87e994e4/raw' | |
Invoke-WebRequest $GistURL -OutFile $Profile.CurrentUserCurrentHost -Headers @{"Cache-Control"="no-cache"} |
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
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"globals" : | |
{ | |
"alwaysShowTabs" : true, | |
"copyOnSelect" : true, | |
"defaultProfile" : "{574e775e-4f2a-5b96-ac1e-a2962a402336}", | |
"initialCols" : 120, | |
"initialRows" : 30, | |
"keybindings" : |