A quick check of HP's specs on that product support page shows this info:
PCIe x16 v3.0 slot - qty 1 - 4.2 in full height, 6.6 in length 75W max. power
A quick check on the power supply in HP's support forums shows someone opening it up to find a 180W variant. You'll need to upgrade to a 400W+ new PSU. I don't think I've seen any made by the usual suspects (EVGA, Seasonic, Corsair) under 400W. I did see in that thread where a 300W can be ordered from HP but I wouldn't recommend that. It's probably poor quality and overpriced knowing PC OEMs like HP.
Also, you'll need a single fan "mini" GTX 1050 Ti. Longer dual fan versions will not fit. EDIT: I just looked up your model Zotac. It appears to be equal in size to a larger single fan mini GPU most other vendors offer targeted at home theater PC builders, so it should fit.
Finally, back to the PSU, check the dimensions of the one in there to make sure it conforms to ATX standard size (L x W x H). Most importantly is to check the four screw hole measurements between them all (W x H) to make sure they fit the standard ATX PSU screw holes that fit in a standard ATX format case. I don't have those measurements off hand but they should be easy to find online.