Quantcast
Channel: PowerShell General
Browsing all 10624 articles
Browse latest View live

How can I determine the clicked cell in a WPF XAML grid ?

I'm presenting a set of records in a WPF xaml listview with datagridview cells: New-Window -Title 'Select Group' -WindowStartupLocation CenterScreen -Width 700 -Height 500 -DataContext...

View Article


Powershell Cmdlet parameters -Tab expansion

 HI TeamAm developing Cmdlets using C#.  Like to clarify the following.1) When attempt to expand the command with tabs,  would the method getDynamicParameters()  be called for every parameter, to fetch...

View Article


Image may be NSFW.
Clik here to view.

List all local groups

Hello,I have a problem while listing local groups via PS v2."net localgroup" runs fine: When I run PS ($obj.psbase.Children | Where {$_.psbase.schemaClassName -eq "group"}) it doesn't stop and program...

View Article

Powershell and Scheduled task

I've a command file that starts a powershell script. This command works fine when I run it in a command box on a windows 2008 R2 server. I can see it because it create a log file.When I add this...

View Article

How run cmd script from powershel using variable with spaces.

I am trying to run cmd script from powershell using variables.If variable contains no spaces script works well, what should I do?My script (c:\scripts\script.cmd):C:\scripts\sed\sed.exe -T -n -e...

View Article


filter the event message output

I have a small script below and need to know how to truncate the output of message field to show onlyNew Logon:   Account NameNetwork Information:  Source Network...

View Article

Need one Powershell script to move the files

Hello... need one powershell script for below requirement.1st we need to copy the file in one FTP location and then we need to Cut & Paste (move) all the files from below folder to another shared...

View Article

convert Text to objects

My PowerShell skills are very limited and I was hoping to get some help.  I need to convert output text from a legacy CLI tool into objects so that I can better utilize Powershell's capabilities.  The...

View Article


Split after regex pattern + space

I have a regex pattern, ".+\s.{2}\s.{3}\s.{3}\s.{2}\s.+\d{4}\s".    I always want to split the text on the last space \s, but keep the string which matches the pattern together.  How to do it? Thank...

View Article


Help with joining two variable arrays

I currently have a script that queries some hyperV hosts in our environment (These are not clustered).The script asks the user for input of the name of the HyperV Hosts they would like to query for...

View Article

Using a batch file to execute .ps1 files in other directories in order

What i have is this batch file that I would like to adapt.  I am new to PS.IN G:\MyDirectory\TestStartFile.batcd /d %~dp0powershell.exe -File sp_script.ps1pauseIN...

View Article

The specified path, file name, or both are too long

HiHoping someone can help, I've been running a script to delete files/folders and it's been running great, however recently some of the folder names have become very long and the script cannot delete...

View Article

How to get an arguments from exe files?

Hi there,I have a problem with silent installation of this exe file - I cannot get any arguments to argument list from this exe file. How can I get some arguments from this file...

View Article


Capture CPU & Memory - every x number of minutes, write to file - almost there?

Hello,I'm trying to capture the cpu utilization and memory from a few servers and write the info to a file.The function below I've worked on and I can't get to the next point of starting by specifying...

View Article

locally run script into running on multiple server

Hi, I have a PS v2 script that was created to run against one server at a time. Its used as a quality control to check if it server installed properly. Mainly does validation with if statements and...

View Article


You cannot call a method on a null-valued expression.

Hi,In my script, i'm trying to get the OU location of the computer on the domain. However for some computers, i get error "You cannot call a method on a null-valued expression." for command...

View Article

Replacing hex character in web.config file

I have the following script that is customizing several web.config files (from an outside vendor). I have discovered that some of these files have an unrecognized character in them (hex C2 A0). Once...

View Article


Powershell Script for getting OS Info for servers in a network range

Hi Friends,We've scripted the below PowerShell script for getting OS info like "server-name, OS Description, Build-Version, Service Pack details" from a list of servers (Ip ranges is gven in...

View Article

PowerShell script to check when the Server was last patched

Friends,Can you please help me with PowerShell script to check when the computer was last patched . I have a made a script with , but it gets the details of all the patches installed.Please advice the...

View Article

Check Internet speed

I m trying to write a powershell script but i am facing some problem.Script-I need Powershell script for measure internet speed for multiple computers.o.s.-Windows 7,Windows 8,vistaKindly help me ASAP.

View Article
Browsing all 10624 articles
Browse latest View live