For issues relating to Windows PowerShell, version 3.0.

learn more… | top users | synonyms

-1
votes
1answer
22 views

Execute a git pull on a remote windows server [closed]

I'm trying to remotely execute a git pull on a Windows server via New-PSSession powershell script. Most git commands like status and help, but when I execute a pull command it just hangs and I confirm ...
6
votes
2answers
298 views

Invoke-Restmethod breaks script in PS 4.0

I had a Powershell script that used Invoke-RestMethod that was working in powershell 3.0. However, I upgraded to powershell 4.0 to fix a bug in powershell 3. When I did so, my script seems to have ...
0
votes
1answer
357 views

The term 'Get-ClusterResource' is not recognized as the name of a cmdlet, function, script file, or operable program

I have a powershell script that I'm attempting to execute over SSH. The command works perfectly when I run it from the server's powershell commandline. Here is my Powershell script: ...
1
vote
1answer
109 views

free disk monitoring windows 2012 - powershell

I have started from scratch to be able to learn how to monitor our server (only one). $dates=(get-date).ToString("s").Replace(":","-") $page="page"+$dates+".csv" get-wmiobject win32_pagefileusage | ...
1
vote
0answers
24 views

Manage UAG Server via WinRM

Does anyone know of there is a way to configure a UAG server to work with WinRM? We have a small number of servers and the "Server Manager" application as well as PowerShell are the way we generally ...
0
votes
0answers
393 views

“powershell has stopped working” on PS exit after creating IIS User

On a Windows Server 2012 box, I'm using PS to create a new IIS User (for automated deployments using MSDeploy). The command itself appears to work fine -- the user is created -- but as soon as I exit ...
7
votes
2answers
339 views

What does 'Not Present' mean in the Get-NetAdapter Powershell Cmdlet?

Server 2012, Powershell 3.0. I'm doing some work that requires automating the enabling and disabling of network adapters. Here is an example of what I see when I run Get-NetAdapter: Name ...
2
votes
2answers
2k views

Powershell: Single Script to “clean” multiple folders of files older than

I would like to create a maintenance script that would run on each of our servers to clean out common drop/archive directories. Preferably the script would use a reference file for the folder path ...
7
votes
0answers
477 views

Set-RDSessionCollectionConfiguration Connection Broker connects to localhost

I am running the following command from a PowerShell console on a Windows 8 machine, trying to configure a Server 2012 R2 RDS Connection Broker: Import-Module RemoteDesktop ...
4
votes
1answer
251 views

What happens when User's UPN Suffix is not Trusted in Active Directory

I have 1275 UPN Suffix in the AD. This is the maximum allowed in Windows Server 2012. $domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain(); $domaindn = ...
0
votes
1answer
91 views

Hyper-V replica - PowerShell - replica merge (detect / invoke)

I need a PowerShell command which can detect replica merge process on the specific VM. And to be sure... There is no way how to invoke replica merge process using a PowerShell command.. Am I right? ...
-1
votes
1answer
855 views

Possible to upgrade PowerShell 2.0 to 3.0 without a reboot?

Is it possible to upgrade powershell without reboot from 2.0 to 3.0 using Windows Server 2008?
1
vote
3answers
936 views

In PowerShell, how can I parse a preformatted output?

Is there existing tooling to take text-based output and pipe it to a dynamic object that can be queried as columns? Specifically, I'm invoking .. query session /server:MYSERVER .. which is ...
4
votes
2answers
90 views

Determine filterable attributes of returned Powershell object

Often when I'm scripting, I will be trying out a command but will want to filter the results. In order to find out what I'm able to filter on I need to know what filterable attributes are going to be ...
0
votes
1answer
302 views

PowerShell Remove-Item can't handle junctions

Windows Server 2012 using PowerShell to create a log file in the temp folder: $LogFile = $env:temp + "\MigrateMyDocs.log" Let's say one's script has already run and you want to delete the log file ...
0
votes
1answer
102 views

Trying to retrieve an error from addding a computer to AD using Powershell

I'm trying to figure out how to retrieve an error from adding a already there computer in Active Directory. Here's the script that I'm using to add my machine in my domain. Add-Computer -DomainName ...
4
votes
1answer
83 views

Powershell script to import CSV to AD

In attempts to automate a few things, I've come across a stumbling block with an import script for AD. A part of the script contains: New-ADUser -Name $Name –GivenName $Person.givenName –Surname ...
2
votes
0answers
403 views

Powershell 3.0 Enter-PSSession fails randomly, reboot solves it. DCOM error in Event Viewer on target machine

Using PowerShell's Enter-PSSession (even locally, against the local computer) fails randomly with the following message. Running Windows 2012 Standard with all updates. The error message takes a while ...
2
votes
2answers
836 views

How do I “catch” a failed command that doesn't work with try…catch?

I'm running the following script that fails for a mailbox that doesn't exist Set-MailboxDatabase rdb16 -AllowFileRestore:$true Mount-Database rdb16 $stats = Get-MailboxStatistics -Database rdb16 ...
1
vote
1answer
287 views

Creating a second domain in a forest using install-addsdomain

I have a domain ludwig.example.com and am trying to create a domain amadeus.example.com using install-addsdomain. I am running this command: install-addsdomain -newdomainname amadeus.example.com ...
0
votes
0answers
280 views

PowerShell doesn't like the -AssignDriveLetter option of the New-Partition cmdlet

I'm trying to create a partition on the USB flash drive using the New-Partition cmdlet. But when I use the -AssignDriveLetter option I get "New-Partition : Invalid Parameter" even though this option ...
1
vote
0answers
349 views

Cannot create partition on disk using PowerShell: “New-Partition : Not enough available capacity”

I'm trying to create two partition on the USB flash drive. The first small 350Mb partition is created fine, but the second throws "New-Partition : Not enough available capacity" even though there is a ...
2
votes
1answer
324 views

Powershell Hyper-V Remote?

Im basically wondering if this is possible, Essentially I have a Powershell 3.0 Script that creates a Hyper-V Server/VHD etc.. it works well but it's obviously defaulting to my local machine. What Im ...
2
votes
3answers
693 views

Adding Unattended.xml Files to Hyper-V Powershell Creation?

As of right now I have a Powershell 3.0 Script Provisioning and Creating Servers. What I want to do is add an Unattended.xml to take it a step further (So I wouldn't have to get on and click ...
3
votes
2answers
684 views

Unattended Install of Windows using Powershell and Hyper-V

Is this possible? I have a script that gets up to the point of Installing Windows Server 2008. However it gets up literally to the "Click Next......etc etc..." and I want to be able to integrate this ...
0
votes
1answer
599 views

Newbie. ForEach, IF, Else

Please educate me. I am trying to test if a file exists on a group of computers' desktop. Some computers are Windows 7 and some are Windows XP. When I run the code, It doesn't test the path on every ...
5
votes
2answers
2k views

Why do weekly tasks created via PowerShell using a different user fail with error 0x41306

We have some scripts that create scheduled jobs using PowerShell as part of our application. When testing them recently, I noticed that some of them always failed immediately, and no output is ever ...
1
vote
1answer
304 views

Hyper-V, Differential Disc, Changing path is resolving junctions - how do stop that?

Gives me a headache. I have a ton of differential discs. In order to move the machiens around - and because (Thank heaven) vm move does NOT copy the sources of differential discs (sadly export does), ...
3
votes
1answer
89 views

How to find the printer driver properties

I have 15 print servers in our environment in different offices. Before upgrading of drivers i would like to display a report with the below information. 32 or 64 bit and Driver last installed or ...
3
votes
1answer
1k views

Assign PowerShell script to run at startup using PowerShell on Window Server 2012

I'm trying to write a PowerShell script that will run when a Windows 2012 instance is created on AWS using the configuration tools provided by AWS. My problem is that I want to change the name of ...
3
votes
1answer
2k views

How do I Setup (Initialize, Partition, and Format) a disk using Powershell?

What is a basic example of going through the setup of a new disk (Initializing it, partitioning it, and formatting) it using powershell?