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
Get-Command -Module PowervRA | |
CommandType Name Version Source | |
----------- ---- ------- ------ | |
Function Connect-vRAServer 4.0.0 PowervRA | |
Function Disconnect-vRAServer 4.0.0 PowervRA | |
Function Get-vRAAPIVersion 4.0.0 PowervRA | |
Function Get-vRACloudAccount 4.0.0 PowervRA | |
Function Get-vRACloudZone 4.0.0 PowervRA |
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
Install-Module -Name PowervRA -Scope CurrentUser |
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
Install-Module -Name PowervRA -RequiredVersion 3.7.0 -Scope CurrentUser |
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
$users = Invoke-RestMethod -Uri 'https://api.github.com/users' | |
$users | ForEach-Object -Parallel { | |
Write-Output "GitHub User $($_.login) has ID $($_.id)" | |
$Seconds = (Get-Random -Minimum 1 -Maximum 10) | |
Start-Sleep -Seconds $Seconds | |
} |
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 Example From: https://blog.netnerds.net/2016/12/runspaces-simplified/ | |
$users = Invoke-RestMethod -Uri 'https://api.github.com/users' | |
$pool = [RunspaceFactory]::CreateRunspacePool(1, 5) | |
$pool.ApartmentState = "MTA" | |
$pool.Open() | |
$runspaces = @() | |
$scriptblock = { |
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
$cluster = Get-Cluster -Name "MyCluster" | |
$spec = New-Object VMware.Vim.VMware.Vim.ClusterConfigSpecEx | |
$spec.orchestration = New-Object VMware.Vim.ClusterOrchestrationInfo | |
$spec.orchestration.defaultVmReadiness = New-Object VMware.Vim.ClusterVmReadiness | |
$spec.orchestration.defaultVmReadiness.readyCondition = 'guestHbStatusGreen' | |
$modify = $true | |
$cluster.ExtensionData.ReconfigureCluster($spec,$modify) |
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
Get-ChildItem test | |
$ErrorDetail = Get-Error | |
Write-Output ($ErrorDetail.CategoryInfo | ConvertTo-Json) |
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
--- | |
- hosts: all | |
tasks: | |
- name: Run a script | |
shell: "{{ playbook_dir }}/files/test_output4.ps1" | |
args: | |
executable: /usr/bin/pwsh | |
register: result1 |
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
--- | |
- hosts: all | |
tasks: | |
- name: Install package dependencies | |
win_chocolatey: | |
name: | |
- chocolatey-core.extension | |
- chocolatey-windowsupdate.extension | |
state: present |
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
--- | |
- hosts: all | |
tasks: | |
- name: Create Registry Entry FileNotFoundCacheEntriesMax | |
win_regedit: | |
path: HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters | |
name: FileNotFoundCacheEntriesMax | |
data: 2000 | |
type: dword |