Questions tagged [powershell-3.0]
Microsoft’s command-line scripting language. V 3.0, which was introduced in Windows 8 and Server 2012, supports code autocompletion (IntelliSense). Remote sessions are more reliable, and there is a bigger selection of cmdlets and built-in functions.
66
questions
0
votes
1
answer
1k
views
Pick up 2 file extensions in a directory using FileSystemWatcher
I am looking to pick up only pdf and rtf files but I get a result of "true" when echoing the variable
$watcher = New-Object System.IO.FileSystemWatcher
Write-Host "First line of the script, getting ...
-1
votes
1
answer
66
views
How to add SAMAccount to results?
Stuck on how to add SAMAccounts (AD usernames) to the results, can anyone help?
Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission | where
{$_.user.tostring() -ne "NT AUTHORITY\SELF" -and $_....
1
vote
0
answers
139
views
PowerShell always launches as administrator
I have inherited a legacy Citrix 6.5 system running on Windows Server 2008. Yes I know this stack isn't for server questions but my feeling is that this workstation question as the server is used for ...
1
vote
0
answers
59
views
Moving an event log source is not having an effect
I'm having an issue that to be clear I'll describe in steps:
I created an event source called Foo in the event log called Application using the following powershell command:
New-EventLog -source Foo -...
3
votes
1
answer
9k
views
Powershell to set default browser
I created a process using PowerShell to install Chrome. What I am looking to do now is to have PowerShell change the registry for the computer and change the default browser to Chrome.
I would ...
1
vote
0
answers
346
views
Windows Server 2012 prevent remote desktop account logging out after inactivity
I've got a process that is running from Powershell on an Windows Server 2012 instance in AWS, however it is currently running under a user's account. The issue is that once the remote desktop ...
1
vote
1
answer
3k
views
Prompting for a user input to be used on a Powershell command?
I'm trying to execute the code below and it is working:
PS C:\> Rename-Computer -NewName TEST -DomainCredential okadamanila\itservices
Given that hostname is given on the PS1 file - however, I ...
2
votes
2
answers
4k
views
Using powershell as default interpreter on Windows 10's SSHD?
When using the default Windows 10 sshd (SSH serv[er|ice] / daemon), how does one set it to login with powershell instead of cmd?
2
votes
1
answer
1k
views
Can't start PowerShell 3.0 on windows 10
I'm having a very strange issue where powershell seems to hang on startup, but only on version 3:
C:\WINDOWS\system32>powershell -version 2.0
Windows PowerShell
Copyright (C) 2009 Microsoft ...
3
votes
2
answers
7k
views
What is psprovider in powershell?
I am new to PowerShell and trying to understand the concept of psprovider. I know I can use Get-PSProvider to show a list of available psproviders
All of the help I am finding, assumes I know things ...
0
votes
1
answer
2k
views
Powershell Get Computer Names who are connected to the Home Directory
In AD we have Home Directory setup, and it points to a File Server which the folder it their [username]. I would like to know who is connect to those Home Directories by Computer Name by using ...
0
votes
2
answers
985
views
Version of MSI to use for SharePoint online management from PowerShell
The following KB article is a rather vague on which MSI to use in what circumstances:
https://www.microsoft.com/en-gb/download/details.aspx?id=35588
There are obviously 32-bit and 64-bit versions. ...
2
votes
1
answer
2k
views
7z archive include directories matching regex
I would like to archive directories that match a regular-expression pattern (/[0-9]{4}/). Does 7z support this?
This doesn't find matching directories:
PS> 7z a -t7z C:\Users\<user>\...
0
votes
0
answers
89
views
Is there a way to assign an alias to the Remote-Item Cmdlet's -Force parameter?
I would like to use the Remove-Item in a similar manner to how it is used in Unix/Linux:
PS> rm -r -f <the_directory>
However, this syntax produces an error:
Remove-Item : Parameter ...
3
votes
1
answer
116
views
Is Exchange User Out of Office?
Finding Users Who Have "Out Of Office" Enabled In Exchange 2010 describes how to use PowerShell to determine if a user has his/her out-of-office setting enabled. However, it requires the use of the ...