Sharepoint 2013 Powershell Files.Add class – preserve version history?

Here is my code (which I posted in another previous thread): ​ $spList = $sharePointSite.Lists[“Special Documents”] $fileStream = ([System.IO.FileInfo](Get-Item $file.FullName)).OpenRead() $contents = New-Object byte[] $fileStream.Length $fileStream.Read($contents, 0, [int]$fileStream.Length); $fileStream.Close(); $spFolder = $sharePointSite.getfolder($spList.Title) ##Changed code here to get subfolder $spFile = $spFolder.Files.Add($file.Name, $contents, $true) $spItem = $spFile.Item My specific question in this case: ​ For the […]

Help With AD Comparison Tool

Greetings All, I have a cursory understand of Powershell and scripting in general, but I have posted below a snippet of code from a tool I have built out for my department that compares two AD User’s groups and based on the side indicator will throw the Group name sorted Alphabetically into an array. The […]

Easiest (best?) way to start private repo

I’d like to create a repo for our company to publish some modules to, but being the first time I’ve done this I’m finding lots of ways to achieve it. Two ways I’m looking at are through Azure files (https://redeploy.se/azure-file-share-ps-module-repository/) and Azure Artifacts (https://docs.microsoft.com/en-us/azure/devops/artifacts/tutorials/private-powershell-library?view=azure-devops). We really have no footprint in Azure at all, so this […]

Having output issues in script trying to find mapped drives of computer

Here is the script ​ $computers = Get-Content -Path “C:mapped.txt” ForEach ($computer in $computers) { Get-WmiObject Win32_MappedLogicalDisk -Computer $computer | select-object PsComputerName, Name, ProviderName | Export-Csv C:mapped_drives.csv -Append } Mapped text contains ​ Computer01 Computer02 Computer03 Computer04 Computer05 In the output, it only displays the results from 01-02. I have tried changing the order, but […]