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
Function Process-RunbookFolder | |
{ | |
Param ( | |
$Path, | |
[switch]$recurse, | |
$WebServiceEndpoint, | |
$Credential | |
) | |
$allwfs = get-childitem -Path $Path -Recurse:$recurse | |
$Global:referencelist = New-Object System.Collections.ArrayList |
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
# Check if reboot is required, if so notify CA. The MSFT_ServerManagerTasks provider is missing on client SKUs | |
$featureData = invoke-wmimethod -EA Ignore -Name GetServerFeature -namespace root\microsoft\windows\servermanager -Class MSFT_ServerManagerTasks | |
$regData = Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" "PendingFileRenameOperations" -EA Ignore | |
if(($featureData -and $featureData.RequiresReboot) -or $regData) | |
{ | |
Write-Verbose $LocalizedData.MachineRequiresReboot | |
$global:DSCMachineStatus = 1 | |
} | |
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
# Script to set a windows computer up for remoting | |
# The script checks the current WinRM/Remoting configuration and makes the necessary changes | |
# set $VerbosePreference="Continue" before running the script in order to see the output of the script | |
# | |
# Written by Trond Hindenes <[email protected]> | |
# | |
# Version 1.0 - July 6th, 2014 | |
Param ( |
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
Workflow NonTerminatingFail1 | |
{ | |
new-item -ItemType file -Path "Z:\snakkes.txt" | |
Write-Output "The script continued" | |
} | |
Workflow TerminatingFail1 | |
{ | |
Param ($FirstNumber,$SecondNUmber) |
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
workflow testwf | |
{ | |
$result = Invoke-restmethod -Uri "http://opendatasalutedata.cloudapp.net/v1/datacatalog/" | |
$out = $result.service.workspace.collection | |
$out | |
} | |
function testfunc | |
{ |
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
workflow testwf | |
{ | |
$out = inlinescript { | |
$result = Invoke-restmethod -Uri "http://opendatasalutedata.cloudapp.net/v1/datacatalog/" | |
$out = $result.service.workspace.collection | |
$out | |
} | |
$out | |
} |
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
#!powershell | |
# This file is part of Ansible. | |
# | |
# Copyright 2014, Paul Durivage <[email protected]> | |
# | |
# Ansible is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
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
Function Process-RunbookFolder | |
{ | |
Param ( | |
$Path, | |
[switch]$recurse, | |
$WebServiceEndpoint, | |
$Credential, | |
[switch]$force | |
) | |
$allwfs =@() |
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
Workflow Dummy-WFInner | |
{ | |
Param ( | |
[Parameter(Mandatory=$true)] | |
[PsCredential]$credential, | |
[Parameter(Mandatory=$true)] | |
[String]$subscriptionid, | |
[Parameter(Mandatory=$true)] |
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
--- | |
- name: Wait for windows reboot | |
hosts: windows | |
gather_facts: False | |
tasks: | |
- shell: 'curl -s -f -k --header "Content-Type: application/soap+xml;charset=UTF-8" --header "WSMANIDENTIFY: unauthenticated" https://{{ ansible_ssh_host }}:{{ ansible_ssh_port }}/wsman --data "<s:Envelope xmlns:s=http://www.w3.org/2003/05/soap-envelope xmlns:wsmid=http://schemas.dmtf.org/wbem/wsman/identity/1/wsmanidentity.xsd><s:Header/><s:Body><wsmid:Identify/></s:Body></s:Envelope>" || true' | |
register: result2 | |
until: result2.stdout.find("Microsoft Corporation") != -1 | |
retries: 30 |