3 Star 14 Fork 10

felord/Microsoft-Integration-and-Azure-Stencils-Pack-for-Visio

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
download-Install-MIS-Azure-Visio-Package.ps1 2.58 KB
一键复制 编辑 原始数据 按行查看 历史
Sandro Pereira 提交于 2020-09-24 10:55 . V7.1.0
######################################################################
# #
# Download and Install Microsoft Integration & Azure Stencils Pack #
# Author: Sandro Pereira #
# #
######################################################################
function DownloadGitHubRepository
{
[OutputType([String])]
param(
[Parameter(Mandatory=$True)]
[string] $Name,
[Parameter(Mandatory=$True)]
[string] $Author,
[Parameter(Mandatory=$False)]
[string] $Branch = "master",
[Parameter(Mandatory=$False)]
[string] $Location = "c:\temp"
)
# Force to create a zip file
$ZipFile = "$location\$Name.zip"
New-Item $ZipFile -ItemType File -Force
#$RepositoryZipUrl = "https://github.com/sandroasp/Microsoft-Integration-and-Azure-Stencils-Pack-for-Visio/archive/master.zip"
$RepositoryZipUrl = "https://api.github.com/repos/$Author/$Name/zipball/$Branch"
# download the zip
Write-Host 'Starting downloading the GitHub Repository'
Invoke-RestMethod -Uri $RepositoryZipUrl -OutFile $ZipFile
Write-Host 'Download finished'
#Extract Zip File
Write-Host 'Starting unziping the GitHub Repository locally'
Expand-Archive -Path $ZipFile -DestinationPath $location -Force
Write-Host 'Unzip finished'
[String]$unzipFolder = (Get-ChildItem -Path $Location -Filter "sandroasp-Microsoft-Integration-and-Azure-Stencils-Pack-for-Visio*" -Recurse -Directory).Fullname
# remove zip file
Remove-Item -Path $ZipFile -Force
return $unzipFolder
}
[String]$location = Split-Path -Parent $PSCommandPath
[String]$gitHubFolder = (DownloadGithubRepository -Name 'Microsoft-Integration-and-Azure-Stencils-Pack-for-Visio' -Author 'sandroasp' -Location $location)[-1]
[String]$location = Get-Location
[String]$destination = Get-ChildItem HKCU:\Software\Microsoft\Office\ -Recurse | Where-Object {$_.PSChildName -eq "Application"} | Get-ItemProperty -Name MyShapesPath | Select-Object -ExpandProperty MyShapesPath
Write-Host 'Starting to install Microsoft Integration & Azure Stencils Pack locally'
$files = Get-ChildItem $gitHubFolder -recurse -force -Filter *.vssx
foreach($file in $files)
{
if($file.PSPath.Contains("Previous Versions") -eq $false)
{
Copy-Item -Path $file.PSPath -Destination $destination -force
}
}
Write-Host 'Microsoft Integration & Azure Stencils Pack installed'
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/felord/Microsoft-Integration-and-Azure-Stencils-Pack-for-Visio.git
git@gitee.com:felord/Microsoft-Integration-and-Azure-Stencils-Pack-for-Visio.git
felord
Microsoft-Integration-and-Azure-Stencils-Pack-for-Visio
Microsoft-Integration-and-Azure-Stencils-Pack-for-Visio
master

搜索帮助