Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Update-GSChromeOSDevice #194

Closed
Foggy2 opened this issue May 27, 2019 · 11 comments
Closed

[Enhancement] Update-GSChromeOSDevice #194

Foggy2 opened this issue May 27, 2019 · 11 comments
Assignees

Comments

@Foggy2
Copy link
Contributor

Foggy2 commented May 27, 2019

It would be great if we could update the following ChromeOS device fields in Google Directory:

  • Asset ID (annotatedAssetID)
  • User (annotatedUser)
  • Notes (notes)
  • Location (AnnotatedLocation)

I think this would fit in with `Update-GSChromeOSDevice' perfectly.

Thanks!

@scrthq
Copy link
Member

scrthq commented May 29, 2019

Hey @Foggy2 - Looks doable! Checking it out, thanks!

@scrthq scrthq self-assigned this May 29, 2019
scrthq added a commit that referenced this issue May 31, 2019
…, #197 (#198)

## 2.28.0

* [Issue #188](#188)
  * Added: `Get-GSDriveFile` now supports specifying a full file path.
  * Fixed: `Get-GSDriveFile` will now replace any special path characters in the filename with underscores
  * Added: The File object returned by `Get-GSDriveFile` will now include an additional `OutFilePath` property if the file is downloaded. This property will contain the full path to the downloaded file.
* [Issue #190](#190)
  * Fixed: `Fields` parameter on `Get-GSDriveFile` and `Update-GSDriveFile` were not being honored.
* [Issue #192](#192)
  * Added: Parameters to `Update-GSDriveFile`:
    * `CopyRequiresWriterPermission [switch]`
    * `Starred [switch]`
    * `Trashed [switch]`
    * `WritersCanShare [switch]`
* [Issue #194](#194)
  * Added: Parameters to `Update-GSChromeOSDevice`:
    * `AnnotatedAssetId [string]`
    * `AnnotatedLocation [string]`
    * `AnnotatedUser [string]`
    * `Notes [string]`
* [Issue #195](#195)
  * Added: `Limit` parameter with `First` alias to the following `List` functions:
    * `Get-GSActivityReport`
    * `Get-GSAdminRole`
    * `Get-GSAdminRoleAssignment`
    * `Get-GSCalendar`
    * `Get-GSCalendarAcl`
    * `Get-GSCalendarEvent`
    * `Get-GSChromeOSDevice`
    * `Get-GSDataTransferApplication`
    * `Get-GSDrive`
    * `Get-GSDriveFileList`
    * `Get-GSDrivePermission`
    * `Get-GSGmailMessageList`
    * `Get-GSGroup`
    * `Get-GSGroupMember`
    * `Get-GSMobileDevice`
    * `Get-GSResource`
    * `Get-GSTask`
    * `Get-GSTaskList`
    * `Get-GSUsageReport`
    * `Get-GSUser`
    * `Get-GSUserLicense`
* [Issue #196](#196)
  * Fixed: `Get-GSTeamDrive` was not paginating through the results.
* [Issue #197](#197)
  * Renamed: `Get-GSTeamDrive` has been changed to `Get-GSDrive`. `Get-GSTeamDrive` has been turned into an alias for `Get-GSDrive` to maintain backwards compatibility.
  * Replaced: `SupportsTeamDrives = $true` with `SupportsAllDrives = $true` on all functions that have it.
* Miscellaneous
  * Fixed: `Export-PSGSuiteConfig` is faster due to safely assuming that the P12Key and/or ClientSecrets values have already been pulled from the corresponding keys.
  * Fixed: Incomplete documentation for `Test-GSGroupMembership`.
  * Added: `UseDomainAdminAccess` switch parameter to `Get-GSTeamDrive`
  * Removed: `Get-GSUserLicenseListPrivate` by rolling the `List` code into `Get-GSUserLicense`
  * Removed: `Get-GSResourceListPrivate` by rolling the `List` code into `Get-GSResource`
scrthq added a commit that referenced this issue May 31, 2019
…, #197

## 2.28.0

* [Issue #188](#188)
  * Added: Get-GSDriveFile now supports specifying a full file path.
  * Fixed: Get-GSDriveFile will now replace any special path characters in the filename with underscores
  * Added: The File object returned by Get-GSDriveFile will now include an additional OutFilePath property if the file is downloaded. This property will contain the full path to the downloaded file.
* [Issue #190](#190)
  * Fixed: Fields parameter on Get-GSDriveFile and Update-GSDriveFile were not being honored.
* [Issue #192](#192)
  * Added: Parameters to Update-GSDriveFile:
    * CopyRequiresWriterPermission [switch]
    * Starred [switch]
    * Trashed [switch]
    * WritersCanShare [switch]
* [Issue #194](#194)
  * Added: Parameters to Update-GSChromeOSDevice:
    * AnnotatedAssetId [string]
    * AnnotatedLocation [string]
    * AnnotatedUser [string]
    * Notes [string]
* [Issue #195](#195)
  * Added: Limit parameter with First alias to the following List functions:
    * Get-GSActivityReport
    * Get-GSAdminRole
    * Get-GSAdminRoleAssignment
    * Get-GSCalendar
    * Get-GSCalendarAcl
    * Get-GSCalendarEvent
    * Get-GSChromeOSDevice
    * Get-GSDataTransferApplication
    * Get-GSDrive
    * Get-GSDriveFileList
    * Get-GSDrivePermission
    * Get-GSGmailMessageList
    * Get-GSGroup
    * Get-GSGroupMember
    * Get-GSMobileDevice
    * Get-GSResource
    * Get-GSTask
    * Get-GSTaskList
    * Get-GSUsageReport
    * Get-GSUser
    * Get-GSUserLicense
* [Issue #196](#196)
  * Fixed: Get-GSTeamDrive was not paginating through the results.
* [Issue #197](#197)
  * Renamed: Get-GSTeamDrive has been changed to Get-GSDrive. Get-GSTeamDrive has been turned into an alias for Get-GSDrive to maintain backwards compatibility.
  * Replaced: SupportsTeamDrives = True with SupportsAllDrives = True on all functions that have it.
* Miscellaneous
  * Fixed: Export-PSGSuiteConfig is faster due to safely assuming that the P12Key and/or ClientSecrets values have already been pulled from the corresponding keys.
  * Fixed: Incomplete documentation for Test-GSGroupMembership.
  * Added: UseDomainAdminAccess switch parameter to Get-GSTeamDrive
  * Removed: Get-GSUserLicenseListPrivate by rolling the List code into Get-GSUserLicense
  * Removed: Get-GSResourceListPrivate by rolling the List code into Get-GSResource
@scrthq
Copy link
Member

scrthq commented May 31, 2019

Hey @Foggy2 - This has been deployed in v2.28.0! Let me know if all is well or if you are seeing any issues!

@Foggy2
Copy link
Contributor Author

Foggy2 commented Jun 5, 2019

Hi @scrthq
I have been trying out this new feature but I have not been having any luck.
Capture
Each time I run the command, it appears to succeed but the properties on the device are not changed.

@scrthq
Copy link
Member

scrthq commented Jun 5, 2019

@Foggy2 - if you do a Get-GSChromeOSDevice for that device after, does it still show as not updated? I've noticed some of Google's APIs will do that with update requests, it can be a bit offputting. Sanity checking the source though in case there's something off there!

@Foggy2
Copy link
Contributor Author

Foggy2 commented Jun 5, 2019

No, still blank unfortunately.
image

I have also checked from the Google Admin Console and the fields are empty.

Have confirmed as well that the https://www.googleapis.com/auth/admin.directory.device.chromeos scope has been allowed in the Manage API Client Access screen.

@scrthq
Copy link
Member

scrthq commented Jun 5, 2019

🤔 checking it out! Thanks for letting me know @Foggy2 !

@Foggy2
Copy link
Contributor Author

Foggy2 commented Jun 5, 2019

I think I see the issue.

Line 155 of Update-GSChromeOSDevice is
$request = $service.Chromeosdevices.Patch($actionBody,$customerId,$dev)
But I think it should be
$request = $service.Chromeosdevices.Patch($Body,$customerId,$dev)

@scrthq
Copy link
Member

scrthq commented Jun 5, 2019

You are 100% correct! Thanks for hunting that down, pushing a build now!

scrthq added a commit that referenced this issue Jun 5, 2019
## 2.28.2

* [Issue #194](#194)
  * Fixed: Parameters not setting correctyl on `Update-GSChromeOSDevice`:
    * `AnnotatedAssetId [string]`
    * `AnnotatedLocation [string]`
    * `AnnotatedUser [string]`
    * `Notes [string]`
@scrthq
Copy link
Member

scrthq commented Jun 5, 2019

@Foggy2 - alrighty, can you update to 2.28.2 and let me know? I'd test but I don't have any Chrome OS devices in either domain tbh 😨

@Foggy2
Copy link
Contributor Author

Foggy2 commented Jun 5, 2019

@scrthq Looks to be working as expected now. Thanks for your work on this!

@scrthq
Copy link
Member

scrthq commented Jun 5, 2019

@Foggy2 - Woohoo! Thanks for your help as well!

@scrthq scrthq closed this as completed Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants