Sharepoint 2013 - Enable versioning with exception for all documents libraries
Hello, I have a script which enable/update all document library on a web app in SharePoint 2013 : if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin…
Add another course for jobs
How about software testing career and certificiation
![](https://techprofile.blob.core.windows.net/images/354873dbf57043e9b91f9fe17109b4d4.png)
Imported PowerShell module shows no ExportedCommands
I have a batch of 150-200 Windows 2016 servers that were upgraded to 2019. Following the upgrade about a dozen of them can no longer run commands from an AWS supplied module, while the others can. Upon further investigation we found that importing the…
PowerShell script to map a network drive to an IaaS resource within Azure
Hi folks I'm trying to map a network drive from a Windows 10 device to an SMB share within Azure. Here's the scenario: Windows Autopilot device AADJ and Intune enrolled Windows 10 Enterprise M365 E5 license No on-prem access,…
gMSA winrm authentication in powershell
How do we use gMSA credentials for remoting another server in same domain
create varible and loops
Create a variable $intfolders that has a value of 10 Create a variable $intPad that has a value of 0 Create a variable $i that has a value of 1 Create a variable for the new folder o New-Variable –Name strPrefix –Value “test folder” –Option…
Powershell begin Process End output
hi, I have the following simple script, this is not running in a function, its running direct in the script [CmdletBinding()] Param( [Parameter(ValueFromPipeline=$True)] [String[]]$Computers ) Begin { Write-host…
Invoke-Command -ScriptBlock returns null rather than empty array
I am trying to run supplied commands in an Invoke-Command -ScriptBlock and retrieve the return value. However returning an empty array, @() , results in null being returned (or at least what is stored in the receiving variable). Example: PS…
ForeEach-Object Paraellel in PowerShell 7 - Debugging/Breakpoint
We started testing out the features of PS7's parallel option for ForEach-Object items. One of the difficulties we had a hard time overcoming is how is one supposed to debug code (via ISE/VSCode) when setting a breakpoint? For example, in the below code…
powershell function
21130-pow.txt How to define a small function on the above script(line 33) to easily loop through the servers on an error using try/catch to go back and look at the server again for any errors.Any suggestions is highly appreciated
powershell filter
, #This will only send the alerts. If (($SendAlert) -and (-not (((get-date).TimeOfDay.totalhours -ge 1) -and ((get-date).timeofday.totalhours -lt 4)))) { …
psRemote Connection Fails Based on Source/Client Machine Config (I think)
I am unable to create a New-psSession FROM a group of computers. Attempting to do so returns an error which includes: “The WinRM client received an HTTP status code of 307 from the remote WS-Management service.” I’ve worked with remoting…
PnP copy .pst in one site collection to new library in another site collection
We are dealing with SharePoint OnPrem / 2016 in this scenario. I have a library template located in Site Collection 1, and need to create a library in site collection 2 using this centrally located .pst file in Site Collection 1. Every example I've…
Moving Folders With FSRM
My team has been asked to set up an automated system to "archive" project directories on our Server 2019 share. In reality they want certain directories to be moved to another location automatically based on a flag file saved within the…
![](https://techprofile.blob.core.windows.net/images/dogZ7twiOkmZ11Wzc_A7Kg.png?8DB47F)
How to kill a WAC initiated process
Hello, I start Windows Admin Center (WAC) and attach to a remote system. There I open a Power Shell and start my application. That application runs for ever in an endless loop. Now I close my WAC so along with that the PS windows also gets closed BUT…
![](https://techprofile.blob.core.windows.net/images/IgFA2BgC5keH52UhTp38sA.png?8D8313)
Powershell Script
Hello Everyone, I'm a beginner Powershell user. Could anyone help me to finish this script? I'd like to copy new files from "$a" to "$b"... automatically of course. How should I move on? Thanks a lot.
Script to check if PC has an SSD and assign disk to variable for later use
I'm trying to create a PowerShell script to check if any of the computer's disks is an SSD and then pass that disk number as a variable to other scripts, which will use it to select which disk a Windows image will be installed to. Also, the SSD must be…
Migrating scripts from Python to Powershell - looking for rstrip equivalent
Hello, I have a pipe delimited data file that I need to read and strip all fields (if necessary) to meet SQL column restraints (for import). In Python, I use rstrip and it works even when a column, for example - Company Name(30) or FirstName(16),…
Unable to connect to Ad server from RSAT server ?
Our AD server is connected to our server via RSAT server. When we are trying to run the AD commands by doing PSRemoting on RSAT server we are not able to get the desired results. But when we run same commands on RSAT server directly we can see the…
Azure Key Vault Set Secret from PowerShell- Pattern Match Exception
I am trying to bulk insert secrets to my Key Vault using power shell and Its throwing me Secret Validation exception saying Pattern Mismatch- ^[0-9a-zA-Z-]+$ But same secret, if i am doing manually in the portal, its working fine. Need some insights…
![](https://techprofile.blob.core.windows.net/images/PT7QlfEdr0qdUKsDf1u5tw.png?8D801B)