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
1 answer

Can I use a format.ps1xml file to format a class created in PowerShell and if so, how?

I've created a class: Class Group { [Guid]$Id [String]$DisplayName [String[]]$Schemas } and a Test.format.ps1xml file:
serialhobbyist
  • 4,768
  • 5
  • 43
  • 65
0
votes
1 answer

How to rename a domain computer in Powershell

I've been trying to rename a domain computer with the following script: $username = "domain\username" $password = "password" $ip = ((ipconfig | findstr [0-9].\.)[0]).Split()[-1] $hostname = (nslookup $ip)[3] $hostname = $hostname.replace(" ",…
Wulf
  • 19
  • 1
  • 6
0
votes
1 answer

Getting Table from Webpage Powershell

I am trying to pull an HTML table from a webpage using PowerShell, but I'm having trouble calling the table itself. There are two tables on the page, one for input and another for output, and ideally I would like to check if the output table…
Cameron
  • 171
  • 3
  • 15
0
votes
1 answer

Add header row to .csv

I realize this is a very commonly asked question, however none of the solutions that have worked in the questions I have found have worked for me. I have a powershell script that creates a .csv file (using new-item) and then populates it with four…
Cameron
  • 171
  • 3
  • 15
0
votes
1 answer

Checking website for delivery status returning all packages regardless of status

I am working on writing a script in powershell to pull up the UPS website and check if a package is delivered or not, and if it is, to deposit the delivered tracking numbers into a .csv, however it seems to either deposit all the packages regardless…
0
votes
0 answers

No output while running script or function. Only output on command line

I have a script file that contains the code below. It runs the same code 3 times. In the script, inside a function In the script, outside a function Out of the script, on the command line Source code: Clear-Host $myKeys =…
Bjorn Mistiaen
  • 6,459
  • 3
  • 18
  • 42
0
votes
1 answer

Powershell parameter type recognition from another module

I have 2 modules one written in c# one written in powershell. The powershell module contains a cmdlet that returns a c# class namespace SxServices { [Cmdlet("Get", "SxWinService")] [OutputType(typeof(SxWinService))] public class…
Alexis Coles
  • 1,227
  • 14
  • 19
0
votes
1 answer

Using Invoke-Command to Get Application Pools on Remote Servers

I'm attempting to use Invoke-Command to get a list of application pools on multiple remote servers. So far I have something like: $servers = Get-Content -Path "C:\Path\to\servers.txt" $array = New-Object -TypeName…
Keefer
  • 59
  • 1
  • 3
  • 8
0
votes
1 answer

Filter Permission by IdentityReference

I am fetching some folder permissions, however, I only want permissiosn that are not "NT AUTHORITY\SYSTEM" or "BUILTIN\Administrators" My code is: $acl = Get-Acl $path $perm = $acl.Access | where{$_.IdentityReference -notmatch "NT…
Saad A
  • 1,135
  • 2
  • 21
  • 46
0
votes
1 answer

PowerShell won't start job

I have the following PowerShell 5 program: $job = Start-Job -ScriptBlock {timeout.exe 10 /NOBREAK} Wait-Job $job When I run it, it terminates immediately with the following output: Id Name PSJobTypeName State HasMoreData …
user1804599
0
votes
2 answers

Pressing while cursor focus is in a text box should activate a specific button on the form. [Powershell]

When a user enters text into one of the search boxes, I would like them to be able to hit Enter to perform the same function as clicking a button would. For example if they were typing in the boxed labeled "Find Username" - they would have the…
0
votes
1 answer

get only shorcut files from desktop in powershell

my power shell version is 5.0 In windows 10, to get all files from desktop, i use Get-ChildItem C:\Desktop\ This returns only the files but i want to get only the short-cut icons name in that directory. I also use this Get-ChildItem…
user6633897
  • 185
  • 1
  • 8
0
votes
2 answers

Error when adding powerShell snapins for Microsoft SharePoint

I have SharePoint PowerShell scripts that I need to run locally on PowerShell v5.0 I've tried to execute Add-PSSnapin "Microsoft.SharePoint.PowerShell" but it throws error: The Windows PowerShell snap-in 'Microsoft.SharePoint.PowerShell' is not…
0
votes
1 answer

Pass variable to XAML

Windows 7, PowerShell 5 In Bruce Payette's book "Windows Powershell In Action" (2) on page 754 there is a WPF example called "Building a file search tool". I need to modify the ComboBox (originally a TextBox) in the XAML by passing in PowerShell…
Archdeacon
  • 193
  • 1
  • 4
  • 15
0
votes
0 answers

How to access objects within objects in PowerShell

PowerShell v5.0 running on Windows 10 Pro. Calling script as: $Test = RunMyScript works fine. $Test contains this: itemthefirst : afa;lskejrpoieqqrelkj Id : a;slkdjfepoieuprwieurep anotherID :…
Vorpal Swordsman
  • 393
  • 1
  • 5
  • 14