Tagged Questions
1
vote
2answers
50 views
String comparison not working in Powershell function - what am I doing wrong?
Okay, I'm a powershell newbie, and probably making a stupid mistake; hopefully someone here can sort me out in a hurry. What I'm trying to do is make an alias of git commit which also logs the message ...
0
votes
1answer
30 views
PowerShell Convertto-HTML add data to column
I have this script
$a = "<style>"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color:black;}"
$a = $a + "Table{background-color:#ffffff;border-collapse: collapse;}"
$a = $a + ...
0
votes
1answer
56 views
How to schedule a powershell script for automating wack process through windows scheduler?
I am able to execute the below command from PowerShell prompt and command prompt, but I am unable to schedule it using windows scheduler.
powershell script code:
appcert.exe test -apptype metrostyle ...
1
vote
1answer
37 views
Why does this Powershell function return more than just true/false?
Function lyncNotFocused {
# We need to check if the Lync window (conversation?) has focus or not.
$hwnd = [WhichWindowActive]::GetForegroundWindow()
$proc = [IntPtr]::Zero
...
0
votes
1answer
39 views
Using the Get-EventSubscriber cmdlet in Powershell
I am having a problem for a script I am working on, I must have already dedicated a good 4 hours to this problem, so now I turn here. I have the follow code, shortened it for everyone:
while($true){
...
0
votes
1answer
69 views
Call VBScript With Return Value on Remote Machine With Powershell
I need to call a remote VB script from Powershell, and the VB script needs to run on the remote machine.
I have been using \$computer\root\cimv2:Win32_Process").Create(C:\test.vbs)
This works, ...
0
votes
3answers
214 views
Trying to export an array to csv using powershell (array objects are ; delimited and contain newlines)
Okay, so I have this array, which is essentially an Import-Csv of a CSV file. Each object in the array is an entire CSV row. The input file renders properly when I open it with Excel (The columns ...
0
votes
0answers
103 views
Powershell MYSQL query syntax with Variable
The sqlwriterow function I sends a query and retrieves the data from the specific row I'm looking for.
I have a problem when I send querys containing powershell variables. Now instead of writing ...
0
votes
1answer
70 views
PowerShell script to replace/update specific files on a fileshare
I'm new to PowerShell and I need some help with this script. Can anyone help me figure out what I'm doing wrong?
I am trying to search several directories and replace all instances of newfile.swf.
...
2
votes
2answers
95 views
Start-Job passing XML object to -ArgumentList working different in Powershell V2 & V3
I'm testing a deployment script for my application on Windows Server 2012 with Powershell v3. The script runs fine on Win Server 2008 R2 and Win 7 with Powershell v2. The issue I'm running into now ...
1
vote
2answers
58 views
powershell condition not processing all values in an array
I am newb in powershell but keen to put it into good use. I am working on a script which should do the following:
Check for the existence of a specific folder in a specific location (mapped drive)
...
0
votes
2answers
75 views
Powershell API Post Variable to Ducksboard
Trying to use the following Powershell script which I've taken from Github to push data into a Ducksboard dashboard. The function works excellently however I need to feed in a variable as part of the ...
0
votes
2answers
49 views
Insert data into file based on file name using powershell
I have a powershell script that goes into a files, and for every instance of E:, it will replace it with CBM-FS01|2013-02-03|E:
$filenames = @("C:\SCRIPT\CBM-FS01-E-20130203114114.txt.out")
foreach ...
2
votes
2answers
41 views
variables in strings with powershell
Im trying to build a variable consisting of several other variables to then include, eg:
$myString = "{$_.Name -like "
$myString += $computer[0]
$myString += " -Or $_.Name -like "
$myString += ...
0
votes
4answers
195 views
Using Batch to run remote PowerShell V1.0 command
I am trying to gather some information from my Hyper-V hosts. I have a whole bunch of them and would like to automate this process.
I need to get the Virtual machines that are running on each host.
I ...