Hi,
I am trying to read a value from SPS-Skills UPS property using the following powershell code:
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
add-type -path "C:\program files\common files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.Office.Server.dll"
$PSSnapIn = Get-PSSnapin|where {$_.Name -like "*sharepoint*"}
if (!($PSSnapIn.Name -like "*sharepoint*"))
{
Add-PSSnapin Microsoft.SharePoint.PowerShell
}
$Site = Get-SPSite 'https://webapp.rjc.ca' -Limit 1
$ServiceContext = Get-SPServiceContext($Site)
$ProfileManager = New-object Microsoft.Office.Server.UserProfiles.UserProfileManager($ServiceContext)
$Profiles = $ProfileManager.GetEnumerator() #Loads the user profiles into an array
$StreamWriter = [System.IO.StreamWriter] "c:\users\sk_admin\desktop\skills.txt"
Foreach ($Profile in $Profiles)
{
$CurrentValue = $Profile["SPS-Skills"].Value
$StreamWriter.WriteLine($CurrentValue)
}
$StreamWriter.close()However when it returns the result it only shows the first of the list of skills. EG: it only shows Technical Support, when it should show all the below:
Further to the question how would I go about writing more then one skill.