Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise PowerShell Extensions Forum update-PWFolderSecurity not found.
    • Sign In

    • State Not Answered
    • Replies 20 replies
    • Subscribers 67 subscribers
    • Views 1786 views
    • Users 0 members are here

    update-PWFolderSecurity not found.

    Robert Biggar
    Offline Robert Biggar over 1 year ago

    I am trying to add some security to a folder and I am getting  the below error:

    PS C:\PS> UpdatePWFolderSecurity
    UpdatePWFolderSecurity : The term 'UpdatePWFolderSecurity' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
    included, verify that the path is correct and try again.
    At line:1 char:1
    + UpdatePWFolderSecurity
    + ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (UpdatePWFolderSecurity:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    get-help is finding the cmdlet:

    PS C:\PS> get-help UpdatepwfolderSecurity -full

    Name Category Module Synopsis
    ---- -------- ------ --------
    Update-PWFolderSecurity Cmdlet PWPS_DAB UpdatePWFolderSecurity is used to add user(s), group(s), or userlist(s) access control to specified folders.
    Update-PWFolderSecurityByUserL... Cmdlet PWPS_DAB UpdatePWFolderSecurityByUserListSwapWithWorkflow is used to replace existing userlists with another.

    I tried re-importing pwps_dab:

    PS C:\PS> Import-Module pwps_dab
    Security Protocol now set to TLS 1.2
    PWPS_DAB Version is 2.0.6.0
    This is a 32-bit process.
    WARNING: The names of some imported commands from the module 'pwps_dab' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.

    I even re-installed.

    VERBOSE: Module 'pwps_dab' was installed successfully to path 'C:\Program Files (x86)\WindowsPowerShell\Modules\pwps_dab\2.0.6.0'.

    "Missing something, I am..."

    any ideas? 

    all the other cmdlets I call seem to be fine(of course I don't use "ALL", but...)

    Thanks!

    • Sign in to reply
    • Cancel

    Top Replies

    • Kevin van Haaren
      Offline Kevin van Haaren Fri, Apr 8 2022 10:27 PM in reply to Robert Biggar +1
      I see this when copying pasting from Outlook all the time. Also issues with smart quotes. In fact I've seen this so much I wrote a little function that fixes it for me. It converts smart double quotes…
    • Robert Biggar
      0 Offline Robert Biggar Mon, Apr 11 2022 7:17 AM in reply to Kevin van Haaren

      That's good stuff, I'm going to grab these...

      this is the first time I have run into these dashes...but I guarantee I won't be forgetting this lesson anytime soon! :-D

      Thanks for the script; I will add it into my profile as well!

      the HTML conversion for links into normal strings I ran into a couple weeks ago...but in Excel. So this looks like a pretty interesting solution in PWRShell.

      They haven't come up often for me, but they are "sticky" when they do!

      I appreciate the help, Thanks Kevin!!

      Bob

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Fri, Apr 8 2022 10:27 PM in reply to Robert Biggar

      I see this when copying pasting from Outlook all the time. Also issues with smart quotes. In fact I've seen this so much I wrote a little function that fixes it for me. It converts smart double quotes to dumb double quotes, smart single quotes to dumb single quotes and both endash and emdash to a normal dash.

      I put it in my profile.ps1 so it's always loaded (I also set an alias cc so i don't have to type that long name i came up with)

      # Convert some annoying unicode characters into normal versions
      function Convert-ClipboardUnicodeEntities {
      	$clip = Get-Clipboard -Format Text -Raw -TextFormatType UnicodeText
      	if (-not [string]::IsNullOrEmpty($clip)) {
      		# replace unicode smart open double quotes with dumb straight double quotes
      		$clip=$clip.Replace([char]0x201c,[char]0x0022)
      		# replace unicode smart close double quotes with dumb straight double quotes
      		$clip=$clip.Replace([char]0x201d,[char]0x0022)
      		# replace unicode smart open single quote with dumb straight single quote
      		$clip=$clip.Replace([char]0x2018,[char]0x0027)
      		# replace unicode smart close single quote with dumb straight single quote
      		$clip=$clip.Replace([char]0x2019,[char]0x0027)
      		# replace endash with a dash
      		$clip=$clip.Replace([char]0x2013,[char]0x002D)
      		# replace emdash with a dash
      		$clip=$clip.Replace([char]0x2014,[char]0x002D)
      		Set-Clipboard -Value $Clip
      	}
      }
      

      BTW, if you're interested here's a variation on that will convert a projectwise url string that uses html/url entities and turns them into normal strings. I use this copying urls from Outlook that I want to paste into PW Explorer.

      # Convert HTML & URL entities to string characters
      function Convert-ClipboardHtmlUrlEntities {
      	$clip = Get-Clipboard -Format Text -Raw -TextFormatType Text
      	if (-not [string]::IsNullOrEmpty($clip)) {
      		# URLs can have some weirdly encoded characters, let's fix those
      		# clean up URL characters like %20
      		$clip=[System.Net.WebUtility]::URLDecode($clip)
      		# clean up html entities like <
      		$clip=[System.Net.WebUtility]::HTMLDecode($clip)
      		# replace &space; with a space (this is not a standard html entity, but ProjectWise uses it)
      		$clip=$clip.Replace("&space;"," ")
      		Set-Clipboard -Value $Clip
      	}
      }
      

       

      • Cancel
      • Vote Up +1 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Robert Biggar
      0 Offline Robert Biggar Thu, Apr 7 2022 2:34 PM in reply to Brian Flaherty

      to be sure...I will be "on guard" :-D

      Thanks again, Brian!!

      B

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Brian Flaherty
      0 Offline Brian Flaherty Thu, Apr 7 2022 12:30 PM in reply to Robert Biggar

      Be sure you are not copying and pasting from Word or another application like that. For some reason the dashes are different.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Robert Biggar
      0 Offline Robert Biggar Thu, Apr 7 2022 10:25 AM in reply to Brian Flaherty

      hahaha! 

      It's the "Dash" again  !!!

      Get-PWFolders -FolderID $folderID -JustOne -Slow | Update-PWFolderSecurity ‐MemberType 'ul' ‐MemberName 'MediaWiki' -MemberAccess "fr,fw" -IncludeInheritance -Verbose

      notice the "dash" in front of the "MemberName" is smaller...shows on the command line as a different color

      So.

      I copy the Example line to make sure the syntax I start with is correct...this particular text...has those other dashes

      Problem solved.

      Thank you for your help Guys...that's a new one for me!

      Bob

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    >

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies