Questions tagged [powershell-5.0]

For issues relating to Windows PowerShell, version 5.0

Version 5.0 of Windows PowerShell, Microsoft's task automation and configuration management platform that functions as an interactive command shell and a scripting language. For general information about Windows PowerShell, see the tag wiki for the tag.

Windows PowerShell 5.0 is available as part of the Windows Management Framework (WMF) 5.0.

For the latest news and developments, check out the PowerShell blog.

909 questions
0
votes
2 answers

How to save & use a ReST response in further requests in PowerShell

I am trying to implement a ReST request in PowerShell. Request 1: $response = Invoke-RestMethod "my-custom-url" -Headers $headers -Method POST -Body $json -ContentType "application/json" -OutFile output.json -SessionVariable sv Reponse from…
live2learn
  • 861
  • 2
  • 9
  • 16
0
votes
1 answer

Constructing a path with the format operator throws a type error

I am trying to use the builtin -f feature of PowerShell, but I keep getting hit with an error of Cannot convert 'System.Object[]' to the type 'System.String' required by parameter 'Filter'. Specified method is not supported. Here is my code, what…
0
votes
1 answer

Transform a NoteProperty and computed column object into a string

I want to import file infos and MD5 Hash in SQL Server table using Write-ObjectToSQL Module. I'm trying to do this in one line if possible. Here's what I have: gci -file|select…
PollusB
  • 1,726
  • 2
  • 22
  • 31
0
votes
1 answer

Start-BitsTransfer's Destination field is not mandatory

I had a bug in a script where I'd specified -Description $dest instead of -Destination $dest on a call to Start-BitsTransfer. It didn't error / ran quickly for a small file and took a while for a large one. As such I think the file was copied to my…
JohnLBevan
  • 22,735
  • 13
  • 96
  • 178
0
votes
1 answer

Binding 'Delimiter' In Powershell

I know you can use the export-csv feature to quickly export data to a csv file, but I keep getting an error of Export-csv: can not bind parameter 'Delimiter'. Can nnot convert value "C:\Test' to type System.CharError: String must be exactly one…
FunFly WhiteGuy
  • 163
  • 2
  • 2
  • 11
0
votes
1 answer

Web scraping script issue after updating to Windows 10

I upgraded to Windows 10 a few days ago and I have not been able to get one of my scripts to work. This simple stand-alone script demonstrates the problem: $erroractionpreference = "Continue" $ie = New-Object -ComObject…
Mark
  • 19
  • 1
  • 3
0
votes
1 answer

Piping ListView items in separate runspace

I have a form written in PowerShell (as it uses PS to run commands over hundreds of servers) but this bit had me stumped for awhile: $listview.Invoke([System.Action[String]]{ Param ( [String]$data ) write-warning "1" …
Deadly-Bagel
  • 1,612
  • 1
  • 9
  • 21
0
votes
1 answer

DSC V5 - Keeps attempting to reapply a failed configuraiton

We have started using DSC to deploy some applications. We are pushing out the configurations and only want it to run this configuration once and then stop. However it seems that if a configuration fails we end up with a pending configuration which…
Alexis Coles
  • 1,227
  • 14
  • 19
0
votes
1 answer

ConvertFrom-StringData to hashtable to parse event log

I'm cannibalising the script made available here to try and parse the security event log for certain file audit events. What I am trying to do is restrict the output to events that match a specific file name and access mask. The event parser uses…
LeeM
  • 1,118
  • 8
  • 18
0
votes
0 answers

Script hangs during import of .tsv file to Excel

I have been using a script to import a data.tsv file into Excel which creates a workbook then closes it. It worked in PowerShell 4 under Windows 8.1. I've upgraded to Windows 10 with PowerShell 5. Now it is no longer working. As far as I can tell,…
user3019059
  • 187
  • 1
  • 17
0
votes
0 answers

Sending email fails with error "unable to connect to remote server"

I am trying to send an email in PowerShell 5.0. I am using a gmail address for right now but can't successfully send the email. I'm sure it's due to username and password but I am not sure the syntax of the credentials. send-mailmessage -to "user2…
0
votes
1 answer

Cannot import user-defined module

I have some PowerShell functions and I want to import them into my server 2008 R2 via command Import-Module. So I created a psd1 file and in psm1 I use: Export-ModuleMember -Function "*-*" -Alias *. However when I execute command: PS…
Phong Vo
  • 1,078
  • 7
  • 16
0
votes
1 answer

Verify xml file has data past the first node in Powershell

I want to verify that an xml file has data past any first tier node. My .xml file looks like: <[NodeName] xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> …
Speerian
  • 1,138
  • 1
  • 12
  • 29
0
votes
1 answer

What are the major things missing from earlier versions of Powershell compared with the later versions?

I'm looking for a sort of history lesson. I'm a latecomer to PowerShell. I learned on version 4 and I have a growing number of commandlets that I'm contemplating using in places where version compatibility matters. Most of my unit tests are…
-1
votes
1 answer

How to extract the artrifactId in the pom.xml using Powershell that are not in the parent,build or dependencies tags

I have the below pom.xml file and i want to read only below artifact data and ignore the artifact info that are in between the and tags using powershell regex…