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
$list = @" | |
1 Partridge in a pear tree | |
2 Turtle Doves | |
3 French Hens | |
4 Calling Birds | |
5 Golden Rings | |
6 Geese a laying | |
7 Swans a swimming | |
8 Maids a milking | |
9 Ladies dancing |
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
#set servername variable | |
#$servername = read-host "Input server name" | |
$servernames = @("host1","host2","host3") | |
foreach ($servername in $servernames){ | |
$server = rsc --refreshToken="abcd...wxyz" --host="us-3.rightscale.com" cm15 index /api/servers "filter[]=name==$servername" | |
$instancehref = (($server | ConvertFrom-Json).links | where rel -eq "current_instance").href | |
#start instance command: | |
rsc --refreshToken="abcd...wxyz" cm15 start $instancehref --host="us-3.rightscale.com" |
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
#INPUTS | |
#$ENV:SCOM_MGMT_SERVER = IP Address or FQDN of SCOM Management Server | |
#$ENV:SCOM_MGMT_GROUP = SCOM Management Group, if NULL, attempt to determine via registry | |
#$ENV:SCOM_USERNAME = User that has access to connect remotely to SCOM Management Server and has access to delete managed computers | |
#$ENV:SCOM_PASSWORD = Password for above user | |
#Set Error Action Preference | |
$errorActionPreference = "Stop" | |
#RightLink/RSC Working Directory |
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
$AD_Domain = $ENV:AD_DOMAIN_NAME | |
$AD_NetBios = $ENV:AD_NETBIOS_NAME | |
$AD_OU = $ENV:AD_OU_NAME | |
$AD_Password = $ENV:AD_ADMIN_PASSWORD | |
$AD_User = $ENV:AD_ADMIN_USERNAME | |
$AD_New_Name = $ENV:AD_NEW_SERVER_NAME | |
$Local_Password = $ENV:ADMIN_PASSWORD | |
$Local_Username = $ENV:ADMIN_ACCOUNT_NAME |
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
define sys_get_account_id() return $account_id do | |
# Fetches the account id of "this" cloud app using the default tags set on a | |
# deployment created by SS. | |
# selfservice:href=/api/manager/projects/12345/executions/54354bd284adb8871600200e | |
# | |
# @return [String] The account ID of the current cloud app | |
call get_tags_for_resource(@@deployment) retrieve $tags_on_deployment | |
$href_tag = map $current_tag in $tags_on_deployment return $tag do | |
if $current_tag =~ "(selfservice:href)" | |
$tag = $current_tag |
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
# --- | |
# RightScript Name: Azure - Set Static IP - Windows | |
# Description: Make a IP static for azure | |
# Inputs: | |
# AZURE_ACCOUNT: | |
# Category: Azure | |
# Description: AzureAD username | |
# Input Type: single | |
# Required: true | |
# Advanced: false |
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
name "Package: sys_log" | |
rs_ca_ver 20160622 | |
short_description "Provides logging functionality for sending logs to audit entries in CM" | |
package "sys_log" | |
######################################################## | |
# USAGE | |
# | |
# This package provides log functions to log data to audit entries. You can use the | |
# `summary` definition to set the audit summary and the `detail` definition to add to |
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
#EXAMPLE params: | |
#$name = "CloudAppName" | |
#$options = [ | |
# { | |
# "name": "param_name", | |
# "type": "string", | |
# "value": "param_value" | |
# }, | |
# { | |
# "name": "param_name2", |
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
#Usage: | |
# -Execute entire script to load functions | |
# -Execute the Install-RSC function | |
# -Execute the Publish-CAT function | |
# After loading functions, built-in help notes are available. ie. Get-Help Publish-CAT | |
function Publish-CAT { | |
<# | |
.SYNOPSIS | |
Upload a CAT to RightScale Self-Service. And optionally publish the CAT to the Self-Service Catalog. |
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
#API Docs: http://reference.rightscale.com/selfservice/manager/index.html#/1.0/controller/V1::Controller::ScheduledAction/create | |
#$name is a human-readable name for the scheduled action. ie "my scheduled action" | |
#$action is one of: "launch","start","stop","terminate","run" | |
#$operation_name is only necessary if $action = "run". it's value is the custom operation name | |
#$recurrence is an RRULE as described by RFC 5545. ie "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR" | |
#$timezone in standardized tzinfo names (http://www.iana.org/time-zones) ie "America/Los_Angeles" or "UTC" | |
#$first_occurrence in ISO-8601 DateTime format. ie "2014-07-24T00:00:00+00:00" | |
#Create RUN scheduled action: | |
rs_ss.scheduled_actions.create( |
OlderNewer