Quantcast
Channel: Windows PowerShell forum
Browsing all 21975 articles
Browse latest View live

Powershell $lastexitcode return works on non-zero return but keeps hanging...

So I have performed some major customization on SQLSPADE thats available on CodePlexsqlspade.codeplex.comHere is where I am stuck. I have 2 functions in play. When the first functions executes, It...

View Article


How to check to see if a file is open/locked before trying to copy it

I am trying to copy a set of files and folders fomr one location ot another. It works ok, but if a file is open it generates an error. Is there a way to check to see if a file is open before trying to...

View Article


Where does PowerShell look for DLLs? I have a custom DLL I want to load.

Re: Where does PowerShell look for DLLs? I have a custom DLL I want to load.I wrote a .Net DLL. Currently I am loading it in my PS script with a LoadFrom. I will be distributing my solution to several...

View Article

Need to use -credential in get-wmiobject

Hi,I would like to remotely enumerate printers on our 2012r2 print server from a Windows 7 box. I am logged into the Win7 box with a domain account that is in the local admins group on the print...

View Article

Register-PSSession Problem

Greetings everyone.  I'm trying to assign non-admins access to webadministrationcommandlets.  First I created a configuration file:New-PSSessionConfigurationFile –ModulesToImport WebAdministration...

View Article


PS script to find recursive folders in a path created within a specific time...

Hi there,I'm fairly new to PS and was wondering if anyone could help out with a script to pass in a folder path, then within that path it will recursively check all folders created time, say within...

View Article

Need convert txt to csv using Powershell

Hello,I'm trying to read txt file:================================================== URL               : about:blank Title             :  Visit Time        : 06.10.2014 8:43:03 Visit Count       : 5354...

View Article

Create (security)event

Hello,How can I use PowerShell to create a (security) event?The structure of the message part of the event should be like the following:<EventData><Data...

View Article


Uninstall-Windowsfeature in WS2012 R2

Hi,When I try to remove a feature using Uninstall-Windowsfeature with -Remove it doesn't seems to remove the binaries from the server as when I try to run Install-Windowsfeature for the same feature...

View Article


Install Powershell 3 via GPO?

Hi,I would like to be able to install PowerShell 3 on all of our Windows 2008 R2 SP1 servers.Is GPO the best way to go? (I know very little about GPO)I found this code:@echo off SET...

View Article

Powershell $webclient.UploadFile

Hello Community!I am new to powershell and i have been playing around with getting files to upload using FTP.I have got it working and i am happy with the results but i would like to get the script to...

View Article

Cannot save xlsx file from powershell

Hi.My problem is that I cannot save xlsx file that is created by ps script. Last string drop errors: Microsoft Excel cannot get access to file: C:\Users\PROFILENAME\Desktop\67E69410 This file is...

View Article

Using powershell to check and removing duplicate entries

Hi Guys,I have been trying to get my head around powershell to check a csv file. It needs to read in each line in the csv and compare it to the last one and only pull out the entry with the newest time...

View Article


PowerShell Copy

How do I copy files from one network drive to another network drive using Power Shell.  The files are SQL transaction logs so I need the files for a 24 hour span.  I would like the copy to run at the...

View Article

Test Script using Get-WebSite

I need to be able to test a given web site and ensure that 5 different properties are set correctly.If all the properties are correct, the test script should return true, otherwise false. So far I have...

View Article


Active code page

For some reason, write-host does not display correct Chinese anymore. I tried using chcp 936 but getting 'CHCP : Invalid code page'.

View Article

Get-Childitem with Get-FileHash Info

Hello,I have been able run the following script to get File names in a Recurse folders, although I'm looking to use Get-Filehast too, although I'm not sure or unable to tag this on the end of this...

View Article


Add line to a text file just after a specific line with PowerShell

Hi, I have to edit remotely a file called nsclient.ini on hundreds of computers, the file contains some command definitions. For example:[/settings/external scripts/scripts] check_event="C:\Program...

View Article

Don't Import Last Line In CSV

I'm using PowerShell and Log Parser 2.2 to import CSV data into SQL Server. I've encountered an issue whereby a batch of files has an extra line at the very end (totals) and I don't want it imported....

View Article

Security permission in DNS object

Hi.I have problem with several DNS objects, in security permission disappeared account of himself.I can`t find powershell cmdlet for this action.I need 2 scripts: one for get all dns object without...

View Article
Browsing all 21975 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>