Sha256: fab7fd8d45b1405b79d17b4eb019f3a284ef432077d31298cf6cb126d8651a67

Contents?: true

Size: 925 Bytes

Versions: 1

Compression:

Stored size: 925 Bytes

Contents

#! /usr/bin/env ruby
# frozen_string_literal: false

#
#   powershell_helper.rb
#
# DESCRIPTION:
#   This is meant to execute powershell in the bin/powershell deirectory
#   so we don't have to copy the code out of the GEM. This is meant only as a
#   wrapper.
#
# OUTPUT:
#   N/A
#
# PLATFORMS:
#   Windows
#
# DEPENDENCIES:
#   None
#
# USAGE:
#   C:\opt\sensu\embedded\bin\ruby C:\opt\sensu\embedded\bin\powershell_helper <poweshell-script> ARGS
#
# NOTES:
#
# LICENSE:
#   Copyright 2018 <dasecretzofwar@gmail.com>
#   Released under the same terms as Sensu (the MIT license); see LICENSE for details.
#

if ARGV.empty?
  puts 'You must specify arguments for powershell file'
  exit 2
end

powershell_dir = File.expand_path('./powershell', File.dirname(__FILE__))
command = "Powershell.exe -NonInteractive -NoProfile -ExecutionPolicy Bypass -NoLogo -File #{File.expand_path(ARGV.join(' '), powershell_dir)}"
exec command

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sensu-plugins-windows-3.0.0 bin/powershell_helper.rb