Questions tagged [powershell-5.1]

280 questions
0
votes
1 answer

Powershell - How to script a session refresh in powershell?

I have one ps1 script that drives the operations I want to perform. I am using modules with class definitions in the modules that use Command pattern. All is well and good first time I open a powershell session console and run the script. If I…
user5855178
  • 567
  • 1
  • 7
  • 17
0
votes
1 answer

Why doesn't the full directory name display when passing an exclude parameter which passes it to a for loop to display?

So, I actually don't believe that its the string value I'm passing to the parameter that is the issue, I think its how my for loop is displaying it. Function Get-Users{ [cmdletbinding()] Param( [Parameter(Mandatory=$false, …
Abraham Zinala
  • 4,267
  • 3
  • 9
  • 24
0
votes
1 answer

Need filtering help in PowerShell script

I have an array with some server data and have following script: Write-Host "`nRemoving servers' accounts from AD:" -ForegroundColor Green for ($j=0; $j-le $screenObj.Length; $j++) {if (($screenObj[$j].Domain -ne "Unknown") -and…
0
votes
2 answers

Adding a seperator for each system queried? Custom Object

I am having trouble trying to understand the logic behind my code to get it working properly. Just a quick script I've got, to retrieve Software Versions from a remote system and getting the output into a…
Abraham Zinala
  • 4,267
  • 3
  • 9
  • 24
0
votes
0 answers

Get-QADUser Mailbox?

I have a really generic/basic question. (Please close if not allowed) Currently, I've been adding the quest.activeroles.admanagement snapin to run the QAD cmdlets. Is anyone familiar with how to find Organizational Mailboxes a user is attached to?…
Abraham Zinala
  • 4,267
  • 3
  • 9
  • 24
0
votes
1 answer

Remove an XML node using PowerShell

I'm trying to remove SlowPollGroup from the XML below. is four levels deep in the XML file. I've already found as $markersExists using $markersExists = $vendor.SelectSingleNode("./Markers") script.
Sryn
  • 11
  • 3
0
votes
2 answers

Remove double quotes from path variable in PowerShell

I'm using PowerShell 5.1. I have a script that retrieves the HKLM:\SYSTEM\CurrentControlSet\Services\ImagePath value from the registry. The string that gets returns looks like this: "C:\Program Files\Dir1\Dir2" Note that the double quotes…
Matt Davis
  • 45,297
  • 16
  • 93
  • 124
-1
votes
1 answer

Why is the termination behaviour of vscode different with other GUI program (WinMerge) when invoking from PowerShell?

In Windows PowerShell 5.1, after run & code ., a VSCode window opens, and the control returns back to PowerShell immediately. After the PowerShell exists, the VSCode will not be terminated. On the other hand, when invoke other external program, such…
aruku7230
  • 843
  • 8
  • 20
-1
votes
1 answer

Access row of array that has multiple values

I have an array where the certificate columns has rows that contain multiple values. The ... indicates there are more than one value there. For example, looking at the row for "mo.portalapp1.doris..." This is what I mean by multiple values being…
jssteele89
  • 463
  • 1
  • 4
  • 11
-1
votes
2 answers

the best way or different ways to call a function in powershell 5.1

I am looking for the best way to call a function in powershell. I search on google and find the two below ways to call a function. Ref -…
Ashish Goyanka
  • 207
  • 3
  • 11
1 2 3
18
19