powershell-3.0 Questions

2

Solved

When I run a below command to list log by ID, it says Get-WinEvent : No events were found that match the specified selection criteria. How can I catch this exception and display a simple message s...
Groenendael asked 31/10, 2014 at 17:12

7

We have some scripts that create scheduled jobs using PowerShell as part of our application. When testing them recently, I noticed that some of them always failed immediately, and no output is ever...

11

Solved

Hoping this won't be too difficult but I am writing a script that queries user information from the domain and exports to CSV. The script is run by our administrative staff and all they need to in...
Variolite asked 28/5, 2013 at 6:29

9

Solved

Get-Service *sql* | sort DisplayName | out-file c:/servicelist.txt I have a one line PowerShell script to extract list of all services running on my local machine, now, in addition to displaying ...
Lori asked 27/6, 2014 at 10:2

10

Solved

I'm trying to create a JSON-serialized array. When that array contains only one item I get a string, not an array of strings (in JSON). Multiple Items (works as expected): PS C:\> @("one", "tw...
Subtorrid asked 6/9, 2013 at 17:5

3

Solved

I'm writing a monitoring script in Powershell using a Try/Finally to log a message should the script end. The script is intended to run indefinitely, so I want a way to track unintended exiting. E...
Blush asked 14/7, 2017 at 13:41

3

My understanding is that virtually all "real work" done by the various GUI components in Windows Server 2012 (for example, in Disk Management) is performed by invoking Powershell. (That is, there's...
Gambill asked 3/7, 2013 at 22:22

22

Is there an easy way in PowerShell 3.0 on Windows 7 to get the local computer's IPv4 address into a variable?
Bradbury asked 3/12, 2014 at 17:14

10

Solved

I have following PowerShell script to install application without user intervention: Start-Process -FilePath "C:\Temp\UpgradeClientInstaller\setup.exe" -ArgumentList "/S /v/qn" by giving /s in a...
Health asked 22/9, 2015 at 9:17

7

Solved

Thanks first of all for reviewing this. I've basically got a third-party agent software which allows me to execute PowerShell as LocalSystem. This allows me to easily run remote PowerShell command...
Species asked 19/12, 2013 at 16:5

10

Solved

I am trying to write a powershell script for windows 10 that will automatically launch a Metro-style app. The Start-Process cmdlet seems like it should work, but I cannot get it to launch anything ...
Chamber asked 3/8, 2015 at 23:55

9

Solved

I have the following script code #[string]$password = $( Read-Host "Input password, please" ) param ( [string]$ReleaseFile = $(throw "-ReleaseFile is required"), [string]$Dest...
Spleen asked 20/12, 2013 at 15:26

7

Solved

I use Powershell's Invoke-WebRequest method to download a file from Amazon S3 to my Windows EC2 instance. If I download the file using Chrome, I am able to download a 200 MB file in 5 seconds. The...
Fuentes asked 23/2, 2015 at 20:17

3

Solved

How can I hide the progress display of Invoke-WebRequest? I do a lot of successive requests and have my own Write-Progress display that I use, so I don't need the built-in one popping up underneath...
Fai asked 12/9, 2013 at 17:30

8

Solved

Invoke-RestMethod call returns only very unhelpful exception below and does not (as far as I can tell) allow you to collect the body content (JSON object shown in fiddler trace results). This seems...
Harlequin asked 12/9, 2013 at 18:7

4

Solved

I want to use a PowerShell script to automate tasks related to the user when the user logs in. Sometimes a user will have moved his Documents folder from the default location. How can I determine ...
Gemma asked 16/7, 2014 at 2:51

12

Solved

I cant seem to figure out how to create a new scheduled task that is triggered daily and repeats every 30 minutes. I have been going in circles. Everything about this below works for setting the t...
Dumuzi asked 20/11, 2013 at 22:57

2

I have tried many code but still I am not able to remove read-only property of that particular folder. Below is the code which removes read-only property of the files present under that folder but...
Multiple asked 7/11, 2017 at 14:7

12

Solved

I currently have the following query in PowerShell: query user /server:$server Which returns output: USERNAME SESSIONNAME ID STATE IDLE TIME LOGON TIME svc_chthost 2 Disc 1:05 8/16/2016 12:01 ...
Fr asked 29/8, 2016 at 17:48

2

I want to parse an YAML file from IBM API Connect in a PowerShell file. I won't be able to put third party packages or DLLs since security review won't agree with it. --- product: "1.0.0" info: n...
Batholith asked 19/3, 2019 at 14:15

6

Solved

I'm getting an error when I run a PowerShell script: File test_new.ps1 cannot be loaded. The file test_new.ps1 is not digitally signed. I created a CA and a certificate and signed this file us...
Burglary asked 13/10, 2017 at 10:34

9

I am using PowerShell 3. What is best practice for concatenating files? file1.txt + file2.txt = file3.txt Does PowerShell provide a facility for performing this operation directly? Or do I need...
Abstemious asked 6/6, 2013 at 0:57

4

Like I said, this code works in PowerShell version 2, but not in PowerShell version 5. function wait { $compte = 0 Write-Host "To continue installation and ignore configuration warnings type [y...
Flighty asked 2/5, 2017 at 8:8

3

Solved

I have Powershell 3 installed on my box. I need to test some scripts with Powershell 4 but I want to continue to run some of my scripts that are tested under Powershell 3 and I do not want to brea...
Nicotinism asked 3/4, 2014 at 12:56

7

Solved

I have the following: $test = [pscustomobject]@{ First = "Donald"; Middle = "Fauntleroy"; Last = "Duck"; Age = 80 } $test | Get-Member -MemberType NoteProperty | % {"$($_.Name)="} which pr...
Nucleoside asked 28/11, 2014 at 20:4

© 2022 - 2024 — McMap. All rights reserved.