This file contains hidden or 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
# for WebDriver for Edge | |
[System.Environment]::SetEnvironmentVariable('MSEDGEDRIVER_TELEMETRY_OPTOUT', '1', [System.EnvironmentVariableTarget]::User) | |
# for DOTNET SDK | |
[System.Environment]::SetEnvironmentVariable('DOTNET_CLI_TELEMETRY_OPTOUT', '1', [System.EnvironmentVariableTarget]::User) | |
# for PowerShell | |
[System.Environment]::SetEnvironmentVariable('POWERSHELL_TELEMETRY_OPTOUT', '1', [System.EnvironmentVariableTarget]::User) | |
# for Azure CLI | |
[System.Environment]::SetEnvironmentVariable('AZURE_CORE_COLLECT_TELEMETRY', '1', [System.EnvironmentVariableTarget]::User) | |
# for ML.NET CLI | |
[System.Environment]::SetEnvironmentVariable('MLDOTNET_CLI_TELEMETRY_OPTOUT', '1', [System.EnvironmentVariableTarget]::User) |
This file contains hidden or 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
$mydocuments = [System.Environment]::GetFolderPath("mydocuments") | |
$azpath = join-path $mydocuments -childpath PowerShell Modules Az | |
$versions = get-childItem $azpath | select name | |
foreach($ver in $versions) { | |
write-host "version:" + $ver.name | |
install-module -Name az -RequiredVersion $ver.name -AllowClobber -Force | |
} |
This file contains hidden or 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-module -name PoshSemanticVersion | |
function Get-LatestVersion | |
( | |
[Parameter(Mandatory=$true)] | |
[string]$moduleName | |
) | |
{ | |
$allversions = Get-InstalledModule -Name $moduleName | Sort-Object -Property Version | |
for($i = 0; $i -lt $allversions.Count; $i++){ |
NewerOlder